v2.5.0: adjusted 13 leaf clover, now only affects hero damage rolls

This commit is contained in:
Evan Debenham
2024-07-08 12:02:15 -04:00
parent e93d5da65d
commit 0577817234
103 changed files with 231 additions and 201 deletions
@@ -1358,8 +1358,8 @@ items.trinkets.ratskull.stats_desc=At its current level this trinket will make r
items.trinkets.thirteenleafclover.name=thirteen leaf clover items.trinkets.thirteenleafclover.name=thirteen leaf clover
items.trinkets.thirteenleafclover.desc=Somehow stewing in the alchemy pot has caused this clover to grow a bunch of extra leaves! It's not really clear if this trinket is lucky or unlucky, perhaps this trinket will make your luck more chaotic? items.trinkets.thirteenleafclover.desc=Somehow stewing in the alchemy pot has caused this clover to grow a bunch of extra leaves! It's not really clear if this trinket is lucky or unlucky, perhaps this trinket will make your luck more chaotic?
items.trinkets.thirteenleafclover.typical_stats_desc=Normally when dealing or blocking damage, the game makes numbers closer to the average more common. Typically this this trinket has a _%d%%_ chance to invert this, making numbers closer to the maximum or minimum more likely to appear instead.\n\nThis trinket costs very little energy to upgrade. items.trinkets.thirteenleafclover.typical_stats_desc=Normally when the hero deals damage, numbers closer to the average are more common. Typically this trinket has a _%d%%_ chance to invert this, making your attacks much more likely to deal the maximum or minimum damage instead.\n\nThis trinket costs relatively little energy to upgrade.
items.trinkets.thirteenleafclover.stats_desc=Normally when dealing or blocking damage, the game makes numbers closer to the average more common. At its current level this trinket has a _%d%%_ chance to invert this, making numbers closer to the maximum or minimum more likely to appear instead.\n\nThis trinket costs very little energy to upgrade. items.trinkets.thirteenleafclover.stats_desc=Normally when the hero deals damage, numbers closer to the average are more common. At its current level this trinket has a _%d%%_ chance to invert this, making your attacks much more likely to deal the maximum or minimum damage instead.\n\nThis trinket costs relatively little energy to upgrade.
items.trinkets.trapmechanism.name=trap mechanism items.trinkets.trapmechanism.name=trap mechanism
items.trinkets.trapmechanism.desc=The core mechanism of one of the dungeon's pitfall traps, carefully carved out of the floor so it can be carried. It seems to be magically tied to the dungeon itself, making terrain more hazardous for you and the dungeon's inhabitants. items.trinkets.trapmechanism.desc=The core mechanism of one of the dungeon's pitfall traps, carefully carved out of the floor so it can be carried. It seems to be magically tied to the dungeon itself, making terrain more hazardous for you and the dungeon's inhabitants.
@@ -102,7 +102,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetributio
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ThirteenLeafClover;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFrost; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFrost;
@@ -593,16 +592,6 @@ public abstract class Char extends Actor {
return (acuRoll * accMulti) >= defRoll; return (acuRoll * accMulti) >= defRoll;
} }
//used for damage and blocking calculations, normally just calls NormalIntRange
// but may be affected by things that specifically impact combat number ranges
public static int combatRoll(int min, int max ){
if (Random.Float() < ThirteenLeafClover.combatDistributionInverseChance()){
return ThirteenLeafClover.invCombatRoll(min, max);
} else {
return Random.NormalIntRange(min, max);
}
}
public int attackSkill( Char target ) { public int attackSkill( Char target ) {
return 0; return 0;
} }
@@ -618,7 +607,7 @@ public abstract class Char extends Actor {
public int drRoll() { public int drRoll() {
int dr = 0; int dr = 0;
dr += combatRoll( 0 , Barkskin.currentLevel(this) ); dr += Random.NormalIntRange( 0 , Barkskin.currentLevel(this) );
return dr; return dr;
} }
@@ -764,7 +753,7 @@ public abstract class Char extends Actor {
//TODO improve this when I have proper damage source logic //TODO improve this when I have proper damage source logic
if (AntiMagic.RESISTS.contains(src.getClass()) && buff(ArcaneArmor.class) != null){ if (AntiMagic.RESISTS.contains(src.getClass()) && buff(ArcaneArmor.class) != null){
dmg -= combatRoll(0, buff(ArcaneArmor.class).level()); dmg -= Random.NormalIntRange(0, buff(ArcaneArmor.class).level());
if (dmg < 0) dmg = 0; if (dmg < 0) dmg = 0;
} }
@@ -91,7 +91,7 @@ public class Burning extends Buff implements Hero.Doom {
if (target.isAlive() && !target.isImmune(getClass())) { if (target.isAlive() && !target.isImmune(getClass())) {
int damage = Char.combatRoll( 1, 3 + Dungeon.scalingDepth()/4 ); int damage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 );
Buff.detach( target, Chill.class); Buff.detach( target, Chill.class);
if (target instanceof Hero && target.buff(TimekeepersHourglass.timeStasis.class) == null) { if (target instanceof Hero && target.buff(TimekeepersHourglass.timeStasis.class) == null) {
@@ -22,13 +22,13 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class HoldFast extends Buff { public class HoldFast extends Buff {
@@ -50,7 +50,7 @@ public class HoldFast extends Buff {
public int armorBonus(){ public int armorBonus(){
if (pos == target.pos && target instanceof Hero){ if (pos == target.pos && target instanceof Hero){
return Char.combatRoll(0, 2* ((Hero) target).pointsInTalent(Talent.HOLD_FAST)); return Random.NormalIntRange(0, 2* ((Hero) target).pointsInTalent(Talent.HOLD_FAST));
} else { } else {
detach(); detach();
return 0; return 0;
@@ -122,6 +122,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfTenacity;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ThirteenLeafClover;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLivingEarth; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLivingEarth;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
@@ -566,14 +567,14 @@ public class Hero extends Char {
int dr = super.drRoll(); int dr = super.drRoll();
if (belongings.armor() != null) { if (belongings.armor() != null) {
int armDr = Char.combatRoll( belongings.armor().DRMin(), belongings.armor().DRMax()); int armDr = Random.NormalIntRange( belongings.armor().DRMin(), belongings.armor().DRMax());
if (STR() < belongings.armor().STRReq()){ if (STR() < belongings.armor().STRReq()){
armDr -= 2*(belongings.armor().STRReq() - STR()); armDr -= 2*(belongings.armor().STRReq() - STR());
} }
if (armDr > 0) dr += armDr; if (armDr > 0) dr += armDr;
} }
if (belongings.weapon() != null && !RingOfForce.fightingUnarmed(this)) { if (belongings.weapon() != null && !RingOfForce.fightingUnarmed(this)) {
int wepDr = Char.combatRoll( 0 , belongings.weapon().defenseFactor( this ) ); int wepDr = Random.NormalIntRange( 0 , belongings.weapon().defenseFactor( this ) );
if (STR() < ((Weapon)belongings.weapon()).STRReq()){ if (STR() < ((Weapon)belongings.weapon()).STRReq()){
wepDr -= 2*(((Weapon)belongings.weapon()).STRReq() - STR()); wepDr -= 2*(((Weapon)belongings.weapon()).STRReq() - STR());
} }
@@ -622,6 +623,15 @@ public class Hero extends Char {
if (dmg < 0) dmg = 0; if (dmg < 0) dmg = 0;
return dmg; return dmg;
} }
//damage rolls that come from the hero can have their RNG influenced
public static int heroDamageIntRange(int min, int max ){
if (Random.Float() < ThirteenLeafClover.combatDistributionInverseChance()){
return ThirteenLeafClover.invCombatRoll(min, max);
} else {
return Random.NormalIntRange(min, max);
}
}
@Override @Override
public float speed() { public float speed() {
@@ -370,7 +370,7 @@ public class ElementalStrike extends ArmorAbility {
//*** no enchantment *** //*** no enchantment ***
if (ench == null) { if (ench == null) {
for (Char ch : affected){ for (Char ch : affected){
ch.damage(Math.round(powerMulti* Char.combatRoll(6, 12)), ElementalStrike.this); ch.damage(Math.round(powerMulti* Hero.heroDamageIntRange(6, 12)), ElementalStrike.this);
} }
//*** Kinetic *** //*** Kinetic ***
@@ -538,7 +538,7 @@ public class ElementalStrike extends ArmorAbility {
} else if (ench instanceof Polarized){ } else if (ench instanceof Polarized){
for (Char ch : affected){ for (Char ch : affected){
if (Random.Float() < 0.5f*powerMulti){ if (Random.Float() < 0.5f*powerMulti){
ch.damage(Char.combatRoll(24, 36), ElementalStrike.this); ch.damage(Hero.heroDamageIntRange(24, 36), ElementalStrike.this);
} }
} }
@@ -182,7 +182,7 @@ public class SpiritHawk extends ArmorAbility {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(5, 10); return Random.NormalIntRange(5, 10);
} }
@Override @Override
@@ -267,7 +267,7 @@ public class ElementalBlast extends ArmorAbility {
//### Deal damage ### //### Deal damage ###
Char mob = Actor.findChar(cell); Char mob = Actor.findChar(cell);
int damage = Math.round(Char.combatRoll(15, 25) int damage = Math.round(Hero.heroDamageIntRange(15, 25)
* effectMulti * effectMulti
* damageFactors.get(finalWandCls)); * damageFactors.get(finalWandCls));
@@ -359,7 +359,7 @@ public class ElementalBlast extends ArmorAbility {
charm.ignoreHeroAllies = true; charm.ignoreHeroAllies = true;
mob.sprite.centerEmitter().start(Speck.factory(Speck.HEART), 0.2f, 3); mob.sprite.centerEmitter().start(Speck.factory(Speck.HEART), 0.2f, 3);
} else { } else {
damage = Math.round(Char.combatRoll(15, 25) * effectMulti); damage = Math.round(Hero.heroDamageIntRange(15, 25) * effectMulti);
mob.damage(damage, Reflection.newInstance(finalWandCls)); mob.damage(damage, Reflection.newInstance(finalWandCls));
mob.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10); mob.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10);
} }
@@ -123,7 +123,7 @@ public class WarpBeacon extends ArmorAbility {
int heroDmg = 5 * hero.pointsInTalent(Talent.TELEFRAG); int heroDmg = 5 * hero.pointsInTalent(Talent.TELEFRAG);
hero.damage(Math.min(heroDmg, heroHP-1), WarpBeacon.this); hero.damage(Math.min(heroDmg, heroHP-1), WarpBeacon.this);
int damage = Char.combatRoll(10*hero.pointsInTalent(Talent.TELEFRAG), 15*hero.pointsInTalent(Talent.TELEFRAG)); int damage = Hero.heroDamageIntRange(10*hero.pointsInTalent(Talent.TELEFRAG), 15*hero.pointsInTalent(Talent.TELEFRAG));
existing.sprite.flash(); existing.sprite.flash();
existing.sprite.bloodBurstA(existing.sprite.center(), damage); existing.sprite.bloodBurstA(existing.sprite.center(), damage);
existing.damage(damage, WarpBeacon.this); existing.damage(damage, WarpBeacon.this);
@@ -206,7 +206,7 @@ public class ShadowClone extends ArmorAbility {
@Override @Override
public int damageRoll() { public int damageRoll() {
int damage = Char.combatRoll(10, 20); int damage = Random.NormalIntRange(10, 20);
int heroDamage = Dungeon.hero.damageRoll(); int heroDamage = Dungeon.hero.damageRoll();
heroDamage /= Dungeon.hero.attackDelay(); //normalize hero damage based on atk speed heroDamage /= Dungeon.hero.attackDelay(); //normalize hero damage based on atk speed
heroDamage = Math.round(0.08f * Dungeon.hero.pointsInTalent(Talent.SHADOW_BLADE) * heroDamage); heroDamage = Math.round(0.08f * Dungeon.hero.pointsInTalent(Talent.SHADOW_BLADE) * heroDamage);
@@ -55,6 +55,7 @@ import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
public class SmokeBomb extends ArmorAbility { public class SmokeBomb extends ArmorAbility {
@@ -180,7 +181,7 @@ public class SmokeBomb extends ArmorAbility {
public int drRoll() { public int drRoll() {
int dr = super.drRoll(); int dr = super.drRoll();
dr += Char.combatRoll(Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT), dr += Random.NormalIntRange(Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT),
3*Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT)); 3*Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT));
return dr; return dr;
@@ -99,7 +99,7 @@ public class HeroicLeap extends ArmorAbility {
Char mob = Actor.findChar(hero.pos + i); Char mob = Actor.findChar(hero.pos + i);
if (mob != null && mob != hero && mob.alignment != Char.Alignment.ALLY) { if (mob != null && mob != hero && mob.alignment != Char.Alignment.ALLY) {
if (hero.hasTalent(Talent.BODY_SLAM)){ if (hero.hasTalent(Talent.BODY_SLAM)){
int damage = Char.combatRoll(hero.pointsInTalent(Talent.BODY_SLAM), 4*hero.pointsInTalent(Talent.BODY_SLAM)); int damage = Hero.heroDamageIntRange(hero.pointsInTalent(Talent.BODY_SLAM), 4*hero.pointsInTalent(Talent.BODY_SLAM));
damage += Math.round(hero.drRoll()*0.25f*hero.pointsInTalent(Talent.BODY_SLAM)); damage += Math.round(hero.drRoll()*0.25f*hero.pointsInTalent(Talent.BODY_SLAM));
damage -= mob.drRoll(); damage -= mob.drRoll();
mob.damage(damage, hero); mob.damage(damage, hero);
@@ -114,7 +114,7 @@ public class Shockwave extends ArmorAbility {
Char ch = Actor.findChar(cell); Char ch = Actor.findChar(cell);
if (ch != null && ch.alignment != hero.alignment){ if (ch != null && ch.alignment != hero.alignment){
int scalingStr = hero.STR()-10; int scalingStr = hero.STR()-10;
int damage = Char.combatRoll(5 + scalingStr, 10 + 2*scalingStr); int damage = Hero.heroDamageIntRange(5 + scalingStr, 10 + 2*scalingStr);
damage = Math.round(damage * (1f + 0.2f*hero.pointsInTalent(Talent.SHOCK_FORCE))); damage = Math.round(damage * (1f + 0.2f*hero.pointsInTalent(Talent.SHOCK_FORCE)));
damage -= ch.drRoll(); damage -= ch.drRoll();
@@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class ArmoredStatue extends Statue { public class ArmoredStatue extends Statue {
@@ -74,7 +75,7 @@ public class ArmoredStatue extends Statue {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll( armor.DRMin(), armor.DRMax()); return super.drRoll() + Random.NormalIntRange( armor.DRMin(), armor.DRMax());
} }
//used in some glyph calculations //used in some glyph calculations
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.sprites.BatSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.BatSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.watabou.utils.Random;
public class Bat extends Mob { public class Bat extends Mob {
@@ -49,7 +50,7 @@ public class Bat extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 5, 18 ); return Random.NormalIntRange( 5, 18 );
} }
@Override @Override
@@ -59,7 +60,7 @@ public class Bat extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
@Override @Override
@@ -111,7 +111,7 @@ public class Bee extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( HT / 10, HT / 4 ); return Random.NormalIntRange( HT / 10, HT / 4 );
} }
@Override @Override
@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.BruteSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class Brute extends Mob { public class Brute extends Mob {
@@ -57,8 +58,8 @@ public class Brute extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return buff(BruteRage.class) != null ? return buff(BruteRage.class) != null ?
Char.combatRoll( 15, 40 ) : Random.NormalIntRange( 15, 40 ) :
Char.combatRoll( 5, 25 ); Random.NormalIntRange( 5, 25 );
} }
@Override @Override
@@ -68,7 +69,7 @@ public class Brute extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 8); return super.drRoll() + Random.NormalIntRange(0, 8);
} }
@Override @Override
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CrabSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CrabSprite;
import com.watabou.utils.Random;
public class Crab extends Mob { public class Crab extends Mob {
@@ -43,7 +44,7 @@ public class Crab extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 7 ); return Random.NormalIntRange( 1, 7 );
} }
@Override @Override
@@ -53,6 +54,6 @@ public class Crab extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
} }
@@ -84,7 +84,7 @@ public class CrystalGuardian extends Mob{
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 10, 16 ); return Random.NormalIntRange( 10, 16 );
} }
@Override @Override
@@ -106,7 +106,7 @@ public class CrystalGuardian extends Mob{
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 10); return super.drRoll() + Random.NormalIntRange(0, 10);
} }
@Override @Override
@@ -122,7 +122,7 @@ public class CrystalSpire extends Mob {
Char ch = Actor.findChar(i); Char ch = Actor.findChar(i);
if (ch != null && !(ch instanceof CrystalWisp || ch instanceof CrystalSpire)){ if (ch != null && !(ch instanceof CrystalWisp || ch instanceof CrystalSpire)){
int dmg = Char.combatRoll(6, 15); int dmg = Random.NormalIntRange(6, 15);
//guardians are hit harder by the attack //guardians are hit harder by the attack
if (ch instanceof CrystalGuardian) { if (ch instanceof CrystalGuardian) {
@@ -75,7 +75,7 @@ public class CrystalWisp extends Mob{
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 5, 10 ); return Random.NormalIntRange( 5, 10 );
} }
@Override @Override
@@ -85,7 +85,7 @@ public class CrystalWisp extends Mob{
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
@Override @Override
@@ -123,7 +123,7 @@ public class CrystalWisp extends Mob{
Char enemy = this.enemy; Char enemy = this.enemy;
if (hit( this, enemy, true )) { if (hit( this, enemy, true )) {
int dmg = Char.combatRoll( 5, 10 ); int dmg = Random.NormalIntRange( 5, 10 );
enemy.damage( dmg, new LightBeam() ); enemy.damage( dmg, new LightBeam() );
if (!enemy.isAlive() && enemy == Dungeon.hero) { if (!enemy.isAlive() && enemy == Dungeon.hero) {
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.DM100Sprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.DM100Sprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Callback; import com.watabou.utils.Callback;
import com.watabou.utils.Random;
public class DM100 extends Mob implements Callback { public class DM100 extends Mob implements Callback {
@@ -58,7 +59,7 @@ public class DM100 extends Mob implements Callback {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 2, 8 ); return Random.NormalIntRange( 2, 8 );
} }
@Override @Override
@@ -68,7 +69,7 @@ public class DM100 extends Mob implements Callback {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
@Override @Override
@@ -94,7 +95,7 @@ public class DM100 extends Mob implements Callback {
Invisibility.dispel(this); Invisibility.dispel(this);
if (hit( this, enemy, true )) { if (hit( this, enemy, true )) {
int dmg = Char.combatRoll(3, 10); int dmg = Random.NormalIntRange(3, 10);
dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); dmg = Math.round(dmg * AscensionChallenge.statModifier(this));
enemy.damage( dmg, new LightningBolt() ); enemy.damage( dmg, new LightningBolt() );
@@ -57,7 +57,7 @@ public class DM200 extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 10, 25 ); return Random.NormalIntRange( 10, 25 );
} }
@Override @Override
@@ -67,7 +67,7 @@ public class DM200 extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 8); return super.drRoll() + Random.NormalIntRange(0, 8);
} }
@Override @Override
@@ -45,7 +45,7 @@ public class DM201 extends DM200 {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 15, 25 ); return Random.NormalIntRange( 15, 25 );
} }
private boolean threatened = false; private boolean threatened = false;
@@ -91,7 +91,7 @@ public class DM300 extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 15, 25 ); return Random.NormalIntRange( 15, 25 );
} }
@Override @Override
@@ -101,7 +101,7 @@ public class DM300 extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 10); return super.drRoll() + Random.NormalIntRange(0, 10);
} }
public int pylonsActivated = 0; public int pylonsActivated = 0;
@@ -63,7 +63,7 @@ public class DemonSpawner extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 12); return super.drRoll() + Random.NormalIntRange(0, 12);
} }
@Override @Override
@@ -89,7 +89,7 @@ public class DwarfKing extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 15, 25 ); return Random.NormalIntRange( 15, 25 );
} }
@Override @Override
@@ -99,7 +99,7 @@ public class DwarfKing extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 10); return super.drRoll() + Random.NormalIntRange(0, 10);
} }
private int phase = 1; private int phase = 1;
@@ -693,7 +693,7 @@ public class DwarfKing extends Mob {
} }
} else { } else {
Char ch = Actor.findChar(pos); Char ch = Actor.findChar(pos);
ch.damage(Char.combatRoll(20, 40), this); ch.damage(Random.NormalIntRange(20, 40), this);
if (((DwarfKing)target).phase == 2){ if (((DwarfKing)target).phase == 2){
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){ if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
target.damage(target.HT/18, new KingDamager()); target.damage(target.HT/18, new KingDamager());
@@ -81,10 +81,10 @@ public abstract class Elemental extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
if (!summonedALly) { if (!summonedALly) {
return Char.combatRoll(20, 25); return Random.NormalIntRange(20, 25);
} else { } else {
int regionScale = Math.max(2, (1 + Dungeon.scalingDepth()/5)); int regionScale = Math.max(2, (1 + Dungeon.scalingDepth()/5));
return Char.combatRoll(5*regionScale, 5 + 5*regionScale); return Random.NormalIntRange(5*regionScale, 5 + 5*regionScale);
} }
} }
@@ -108,10 +108,10 @@ public abstract class Elemental extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
protected int rangedCooldown = Char.combatRoll( 3, 5 ); protected int rangedCooldown = Random.NormalIntRange( 3, 5 );
@Override @Override
protected boolean act() { protected boolean act() {
@@ -183,7 +183,7 @@ public abstract class Elemental extends Mob {
@Override @Override
public boolean add( Buff buff ) { public boolean add( Buff buff ) {
if (harmfulBuffs.contains( buff.getClass() )) { if (harmfulBuffs.contains( buff.getClass() )) {
damage( Char.combatRoll( HT/2, HT * 3/5 ), buff ); damage( Random.NormalIntRange( HT/2, HT * 3/5 ), buff );
return false; return false;
} else { } else {
return super.add( buff ); return super.add( buff );
@@ -384,7 +384,7 @@ public abstract class Elemental extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
if (!summonedALly) { if (!summonedALly) {
return combatRoll(10, 12); return Random.NormalIntRange(10, 12);
} else { } else {
return super.damageRoll(); return super.damageRoll();
} }
@@ -69,7 +69,7 @@ public class Eye extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(20, 30); return Random.NormalIntRange(20, 30);
} }
@Override @Override
@@ -79,7 +79,7 @@ public class Eye extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 10); return super.drRoll() + Random.NormalIntRange(0, 10);
} }
private Ballistica beam; private Ballistica beam;
@@ -184,7 +184,7 @@ public class Eye extends Mob {
} }
if (hit( this, ch, true )) { if (hit( this, ch, true )) {
int dmg = Char.combatRoll( 30, 50 ); int dmg = Random.NormalIntRange( 30, 50 );
dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); dmg = Math.round(dmg * AscensionChallenge.statModifier(this));
ch.damage( dmg, new DeathGaze() ); ch.damage( dmg, new DeathGaze() );
@@ -57,7 +57,7 @@ public class FetidRat extends Rat {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 2); return super.drRoll() + Random.NormalIntRange(0, 2);
} }
@Override @Override
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.sprites.FungalSentrySprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.FungalSentrySprite;
import com.watabou.utils.Random;
public class FungalSentry extends Mob { public class FungalSentry extends Mob {
@@ -67,7 +68,7 @@ public class FungalSentry extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(5, 10); return Random.NormalIntRange(5, 10);
} }
@Override @Override
@@ -66,7 +66,7 @@ public class Ghoul extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 16, 22 ); return Random.NormalIntRange( 16, 22 );
} }
@Override @Override
@@ -76,7 +76,7 @@ public class Ghoul extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
@Override @Override
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollSprite;
import com.watabou.utils.Random;
public class Gnoll extends Mob { public class Gnoll extends Mob {
@@ -42,7 +43,7 @@ public class Gnoll extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 6 ); return Random.NormalIntRange( 1, 6 );
} }
@Override @Override
@@ -52,6 +53,6 @@ public class Gnoll extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 2); return super.drRoll() + Random.NormalIntRange(0, 2);
} }
} }
@@ -137,7 +137,7 @@ public class GnollGeomancer extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 3, 6 ); return Random.NormalIntRange( 3, 6 );
} }
@Override @Override
@@ -147,7 +147,7 @@ public class GnollGeomancer extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 6); return super.drRoll() + Random.NormalIntRange(0, 6);
} }
@Override @Override
@@ -692,7 +692,7 @@ public class GnollGeomancer extends Mob {
} }
if (ch != null && !(ch instanceof GnollGeomancer)){ if (ch != null && !(ch instanceof GnollGeomancer)){
ch.damage(Char.combatRoll(6, 12), new GnollGeomancer.Boulder()); ch.damage(Random.NormalIntRange(6, 12), new GnollGeomancer.Boulder());
if (ch.isAlive()){ if (ch.isAlive()){
Buff.prolong( ch, Paralysis.class, ch instanceof GnollGuard ? 10 : 3 ); Buff.prolong( ch, Paralysis.class, ch instanceof GnollGuard ? 10 : 3 );
@@ -795,7 +795,7 @@ public class GnollGeomancer extends Mob {
@Override @Override
public void affectChar(Char ch) { public void affectChar(Char ch) {
ch.damage(Char.combatRoll(6, 12), this); ch.damage(Random.NormalIntRange(6, 12), this);
if (ch.isAlive()) { if (ch.isAlive()) {
Buff.prolong(ch, Paralysis.class, ch instanceof GnollGuard ? 10 : 3); Buff.prolong(ch, Paralysis.class, ch instanceof GnollGuard ? 10 : 3);
} else if (ch == Dungeon.hero){ } else if (ch == Dungeon.hero){
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollGuardSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollGuardSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class GnollGuard extends Mob { public class GnollGuard extends Mob {
@@ -81,9 +82,9 @@ public class GnollGuard extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
if (enemy != null && !Dungeon.level.adjacent(pos, enemy.pos)){ if (enemy != null && !Dungeon.level.adjacent(pos, enemy.pos)){
return Char.combatRoll( 16, 22 ); return Random.NormalIntRange( 16, 22 );
} else { } else {
return Char.combatRoll( 6, 12 ); return Random.NormalIntRange( 6, 12 );
} }
} }
@@ -103,7 +104,7 @@ public class GnollGuard extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 6); return super.drRoll() + Random.NormalIntRange(0, 6);
} }
@Override @Override
@@ -96,7 +96,7 @@ public class GnollSapper extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 6 ); return Random.NormalIntRange( 1, 6 );
} }
@Override @Override
@@ -112,7 +112,7 @@ public class GnollSapper extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 6); return super.drRoll() + Random.NormalIntRange(0, 6);
} }
@Override @Override
@@ -60,7 +60,7 @@ public class Golem extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 25, 30 ); return Random.NormalIntRange( 25, 30 );
} }
@Override @Override
@@ -70,7 +70,7 @@ public class Golem extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 12); return super.drRoll() + Random.NormalIntRange(0, 12);
} }
@Override @Override
@@ -74,9 +74,9 @@ public class Goo extends Mob {
Statistics.qualifiedForBossChallengeBadge = false; Statistics.qualifiedForBossChallengeBadge = false;
Statistics.bossScores[0] -= 100; Statistics.bossScores[0] -= 100;
} }
return Char.combatRoll( min*3, max*3 ); return Random.NormalIntRange( min*3, max*3 );
} else { } else {
return Char.combatRoll( min, max ); return Random.NormalIntRange( min, max );
} }
} }
@@ -95,7 +95,7 @@ public class Goo extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 2); return super.drRoll() + Random.NormalIntRange(0, 2);
} }
@Override @Override
@@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GuardSprite;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Callback; import com.watabou.utils.Callback;
import com.watabou.utils.Random;
public class Guard extends Mob { public class Guard extends Mob {
@@ -63,7 +64,7 @@ public class Guard extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(4, 12); return Random.NormalIntRange(4, 12);
} }
private boolean chain(int target){ private boolean chain(int target){
@@ -136,7 +137,7 @@ public class Guard extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 7); return super.drRoll() + Random.NormalIntRange(0, 7);
} }
@Override @Override
@@ -218,15 +218,15 @@ public class Mimic extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
if (alignment == Alignment.NEUTRAL){ if (alignment == Alignment.NEUTRAL){
return Char.combatRoll( 2 + 2*level, 2 + 2*level); return Random.NormalIntRange( 2 + 2*level, 2 + 2*level);
} else { } else {
return Char.combatRoll( 1 + level, 2 + 2*level); return Random.NormalIntRange( 1 + level, 2 + 2*level);
} }
} }
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 1 + level/2); return super.drRoll() + Random.NormalIntRange(0, 1 + level/2);
} }
@Override @Override
@@ -53,7 +53,7 @@ public class Monk extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 12, 25 ); return Random.NormalIntRange( 12, 25 );
} }
@Override @Override
@@ -68,7 +68,7 @@ public class Monk extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 2); return super.drRoll() + Random.NormalIntRange(0, 2);
} }
@Override @Override
@@ -44,6 +44,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
public class Necromancer extends Mob { public class Necromancer extends Mob {
@@ -93,7 +94,7 @@ public class Necromancer extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
@Override @Override
@@ -225,7 +226,7 @@ public class Necromancer extends Mob {
Char blocker = Actor.findChar(summoningPos); Char blocker = Actor.findChar(summoningPos);
if (blocker.alignment != alignment){ if (blocker.alignment != alignment){
blocker.damage( Char.combatRoll(2, 10), new SummoningBlockDamage() ); blocker.damage( Random.NormalIntRange(2, 10), new SummoningBlockDamage() );
if (blocker == Dungeon.hero && !blocker.isAlive()){ if (blocker == Dungeon.hero && !blocker.isAlive()){
Badges.validateDeathFromEnemyMagic(); Badges.validateDeathFromEnemyMagic();
Dungeon.fail(this); Dungeon.fail(this);
@@ -76,7 +76,7 @@ public class Piranha extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( Dungeon.depth, 4 + Dungeon.depth * 2 ); return Random.NormalIntRange( Dungeon.depth, 4 + Dungeon.depth * 2 );
} }
@Override @Override
@@ -86,7 +86,7 @@ public class Piranha extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, Dungeon.depth); return super.drRoll() + Random.NormalIntRange(0, Dungeon.depth);
} }
@Override @Override
@@ -135,7 +135,7 @@ public class Pylon extends Mob {
private void shockChar( Char ch ){ private void shockChar( Char ch ){
if (ch != null && !(ch instanceof DM300)){ if (ch != null && !(ch instanceof DM300)){
ch.sprite.flash(); ch.sprite.flash();
ch.damage(Char.combatRoll(10, 20), new Electricity()); ch.damage(Random.NormalIntRange(10, 20), new Electricity());
if (ch == Dungeon.hero) { if (ch == Dungeon.hero) {
Statistics.qualifiedForBossChallengeBadge = false; Statistics.qualifiedForBossChallengeBadge = false;
@@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.Ratmogrify; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.Ratmogrify;
import com.shatteredpixel.shatteredpixeldungeon.sprites.RatSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.RatSprite;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class Rat extends Mob { public class Rat extends Mob {
@@ -49,7 +50,7 @@ public class Rat extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 4 ); return Random.NormalIntRange( 1, 4 );
} }
@Override @Override
@@ -59,7 +60,7 @@ public class Rat extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 1); return super.drRoll() + Random.NormalIntRange(0, 1);
} }
private static final String RAT_ALLY = "rat_ally"; private static final String RAT_ALLY = "rat_ally";
@@ -69,7 +69,7 @@ public class RipperDemon extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 15, 25 ); return Random.NormalIntRange( 15, 25 );
} }
@Override @Override
@@ -84,7 +84,7 @@ public class RipperDemon extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
private static final String LAST_ENEMY_POS = "last_enemy_pos"; private static final String LAST_ENEMY_POS = "last_enemy_pos";
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
public class RotHeart extends Mob { public class RotHeart extends Mob {
@@ -125,7 +126,7 @@ public class RotHeart extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
{ {
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.RotLasherSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.RotLasherSprite;
import com.watabou.utils.Random;
public class RotLasher extends Mob { public class RotLasher extends Mob {
@@ -95,7 +96,7 @@ public class RotLasher extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(10, 20); return Random.NormalIntRange(10, 20);
} }
@Override @Override
@@ -105,7 +106,7 @@ public class RotLasher extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 8); return super.drRoll() + Random.NormalIntRange(0, 8);
} }
{ {
@@ -56,7 +56,7 @@ public class Scorpio extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 30, 40 ); return Random.NormalIntRange( 30, 40 );
} }
@Override @Override
@@ -66,7 +66,7 @@ public class Scorpio extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 16); return super.drRoll() + Random.NormalIntRange(0, 16);
} }
@Override @Override
@@ -21,9 +21,9 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty; import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SeniorSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.SeniorSprite;
import com.watabou.utils.Random;
public class Senior extends Monk { public class Senior extends Monk {
@@ -44,7 +44,7 @@ public class Senior extends Monk {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 16, 25 ); return Random.NormalIntRange( 16, 25 );
} }
} }
@@ -56,7 +56,7 @@ public abstract class Shaman extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 5, 10 ); return Random.NormalIntRange( 5, 10 );
} }
@Override @Override
@@ -66,7 +66,7 @@ public abstract class Shaman extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 6); return super.drRoll() + Random.NormalIntRange(0, 6);
} }
@Override @Override
@@ -122,7 +122,7 @@ public abstract class Shaman extends Mob {
if (enemy == Dungeon.hero) Sample.INSTANCE.play( Assets.Sounds.DEBUFF ); if (enemy == Dungeon.hero) Sample.INSTANCE.play( Assets.Sounds.DEBUFF );
} }
int dmg = Char.combatRoll( 6, 15 ); int dmg = Random.NormalIntRange( 6, 15 );
dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); dmg = Math.round(dmg * AscensionChallenge.statModifier(this));
enemy.damage( dmg, new EarthenBolt() ); enemy.damage( dmg, new EarthenBolt() );
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.SkeletonSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
public class Skeleton extends Mob { public class Skeleton extends Mob {
@@ -56,7 +57,7 @@ public class Skeleton extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 2, 10 ); return Random.NormalIntRange( 2, 10 );
} }
@Override @Override
@@ -70,7 +71,7 @@ public class Skeleton extends Mob {
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
Char ch = findChar( pos + PathFinder.NEIGHBOURS8[i] ); Char ch = findChar( pos + PathFinder.NEIGHBOURS8[i] );
if (ch != null && ch.isAlive()) { if (ch != null && ch.isAlive()) {
int damage = Math.round(Char.combatRoll(6, 12)); int damage = Math.round(Random.NormalIntRange(6, 12));
damage = Math.round( damage * AscensionChallenge.statModifier(this)); damage = Math.round( damage * AscensionChallenge.statModifier(this));
//all sources of DR are 2x effective vs. bone explosion //all sources of DR are 2x effective vs. bone explosion
@@ -129,7 +130,7 @@ public class Skeleton extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
} }
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SlimeSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.SlimeSprite;
import com.watabou.utils.Random;
public class Slime extends Mob { public class Slime extends Mob {
@@ -45,7 +46,7 @@ public class Slime extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 2, 5 ); return Random.NormalIntRange( 2, 5 );
} }
@Override @Override
@@ -24,12 +24,10 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook;
import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SnakeSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.SnakeSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Random;
public class Snake extends Mob { public class Snake extends Mob {
@@ -48,7 +46,7 @@ public class Snake extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 4 ); return Random.NormalIntRange( 1, 4 );
} }
@Override @Override
@@ -136,7 +136,7 @@ public class SpectralNecromancer extends Necromancer {
Char blocker = Actor.findChar(summoningPos); Char blocker = Actor.findChar(summoningPos);
if (blocker.alignment != alignment){ if (blocker.alignment != alignment){
blocker.damage( Char.combatRoll(2, 10), new SummoningBlockDamage() ); blocker.damage( Random.NormalIntRange(2, 10), new SummoningBlockDamage() );
if (blocker == Dungeon.hero && !blocker.isAlive()){ if (blocker == Dungeon.hero && !blocker.isAlive()){
Badges.validateDeathFromEnemyMagic(); Badges.validateDeathFromEnemyMagic();
Dungeon.fail(this); Dungeon.fail(this);
@@ -58,7 +58,7 @@ public class Spinner extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(10, 20); return Random.NormalIntRange(10, 20);
} }
@Override @Override
@@ -68,7 +68,7 @@ public class Spinner extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 6); return super.drRoll() + Random.NormalIntRange(0, 6);
} }
private int webCoolDown = 0; private int webCoolDown = 0;
@@ -106,7 +106,7 @@ public class Statue extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, Dungeon.depth + weapon.defenseFactor(this)); return super.drRoll() + Random.NormalIntRange(0, Dungeon.depth + weapon.defenseFactor(this));
} }
@Override @Override
@@ -70,7 +70,7 @@ public class Succubus extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 25, 30 ); return Random.NormalIntRange( 25, 30 );
} }
@Override @Override
@@ -166,7 +166,7 @@ public class Succubus extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 10); return super.drRoll() + Random.NormalIntRange(0, 10);
} }
@Override @Override
@@ -77,7 +77,7 @@ public class Swarm extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 4 ); return Random.NormalIntRange( 1, 4 );
} }
@Override @Override
@@ -101,7 +101,7 @@ public class Tengu extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 6, 12 ); return Random.NormalIntRange( 6, 12 );
} }
@Override @Override
@@ -115,7 +115,7 @@ public class Tengu extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 5); return super.drRoll() + Random.NormalIntRange(0, 5);
} }
boolean loading = false; boolean loading = false;
@@ -626,7 +626,7 @@ public class Tengu extends Mob {
if (PathFinder.distance[cell] < Integer.MAX_VALUE) { if (PathFinder.distance[cell] < Integer.MAX_VALUE) {
Char ch = Actor.findChar(cell); Char ch = Actor.findChar(cell);
if (ch != null && !(ch instanceof Tengu)) { if (ch != null && !(ch instanceof Tengu)) {
int dmg = Char.combatRoll(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth() * 2); int dmg = Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth() * 2);
dmg -= ch.drRoll(); dmg -= ch.drRoll();
if (dmg > 0) { if (dmg > 0) {
@@ -80,7 +80,7 @@ public class Thief extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1, 10 ); return Random.NormalIntRange( 1, 10 );
} }
@Override @Override
@@ -119,7 +119,7 @@ public class Thief extends Mob {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 3); return super.drRoll() + Random.NormalIntRange(0, 3);
} }
@Override @Override
@@ -44,7 +44,7 @@ public class TormentedSpirit extends Wraith {
//50% more damage scaling than regular wraiths //50% more damage scaling than regular wraiths
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1 + Math.round(1.5f*level)/2, 2 + Math.round(1.5f*level) ); return Random.NormalIntRange( 1 + Math.round(1.5f*level)/2, 2 + Math.round(1.5f*level) );
} }
//50% more accuracy (and by extension evasion) scaling than regular wraiths //50% more accuracy (and by extension evasion) scaling than regular wraiths
@@ -62,7 +62,7 @@ public class Warlock extends Mob implements Callback {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 12, 18 ); return Random.NormalIntRange( 12, 18 );
} }
@Override @Override
@@ -72,7 +72,7 @@ public class Warlock extends Mob implements Callback {
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 8); return super.drRoll() + Random.NormalIntRange(0, 8);
} }
@Override @Override
@@ -115,7 +115,7 @@ public class Warlock extends Mob implements Callback {
Sample.INSTANCE.play( Assets.Sounds.DEBUFF ); Sample.INSTANCE.play( Assets.Sounds.DEBUFF );
} }
int dmg = Char.combatRoll( 12, 18 ); int dmg = Random.NormalIntRange( 12, 18 );
dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); dmg = Math.round(dmg * AscensionChallenge.statModifier(this));
enemy.damage( dmg, new DarkBolt() ); enemy.damage( dmg, new DarkBolt() );
@@ -72,7 +72,7 @@ public class Wraith extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 1 + level/2, 2 + level ); return Random.NormalIntRange( 1 + level/2, 2 + level );
} }
@Override @Override
@@ -238,9 +238,9 @@ public class YogDzewa extends Mob {
if (hit( this, ch, true )) { if (hit( this, ch, true )) {
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)) { if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)) {
ch.damage(Char.combatRoll(30, 50), new Eye.DeathGaze()); ch.damage(Random.NormalIntRange(30, 50), new Eye.DeathGaze());
} else { } else {
ch.damage(Char.combatRoll(20, 30), new Eye.DeathGaze()); ch.damage(Random.NormalIntRange(20, 30), new Eye.DeathGaze());
} }
if (Dungeon.level.heroFOV[pos]) { if (Dungeon.level.heroFOV[pos]) {
ch.sprite.flash(); ch.sprite.flash();
@@ -645,12 +645,12 @@ public class YogDzewa extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 15, 25 ); return Random.NormalIntRange( 15, 25 );
} }
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 4); return super.drRoll() + Random.NormalIntRange(0, 4);
} }
} }
@@ -172,12 +172,12 @@ public abstract class YogFist extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 18, 36 ); return Random.NormalIntRange( 18, 36 );
} }
@Override @Override
public int drRoll() { public int drRoll() {
return super.drRoll() + Char.combatRoll(0, 15); return super.drRoll() + Random.NormalIntRange(0, 15);
} }
{ {
@@ -449,7 +449,7 @@ public abstract class YogFist extends Mob {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll( 22, 44 ); return Random.NormalIntRange( 22, 44 );
} }
@Override @Override
@@ -499,7 +499,7 @@ public abstract class YogFist extends Mob {
Char enemy = this.enemy; Char enemy = this.enemy;
if (hit( this, enemy, true )) { if (hit( this, enemy, true )) {
enemy.damage( Char.combatRoll(10, 20), new LightBeam() ); enemy.damage( Random.NormalIntRange(10, 20), new LightBeam() );
Buff.prolong( enemy, Blindness.class, Blindness.DURATION/2f ); Buff.prolong( enemy, Blindness.class, Blindness.DURATION/2f );
if (!enemy.isAlive() && enemy == Dungeon.hero) { if (!enemy.isAlive() && enemy == Dungeon.hero) {
@@ -565,7 +565,7 @@ public abstract class YogFist extends Mob {
Char enemy = this.enemy; Char enemy = this.enemy;
if (hit( this, enemy, true )) { if (hit( this, enemy, true )) {
enemy.damage( Char.combatRoll(10, 20), new DarkBolt() ); enemy.damage( Random.NormalIntRange(10, 20), new DarkBolt() );
Light l = enemy.buff(Light.class); Light l = enemy.buff(Light.class);
if (l != null){ if (l != null){
@@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class MirrorImage extends NPC { public class MirrorImage extends NPC {
@@ -150,7 +151,7 @@ public class MirrorImage extends NPC {
public int drRoll() { public int drRoll() {
int dr = super.drRoll(); int dr = super.drRoll();
if (hero != null && hero.belongings.weapon() != null){ if (hero != null && hero.belongings.weapon() != null){
return dr + Char.combatRoll(0, hero.belongings.weapon().defenseFactor(this)/2); return dr + Random.NormalIntRange(0, hero.belongings.weapon().defenseFactor(this)/2);
} else { } else {
return dr; return dr;
} }
@@ -43,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class PrismaticImage extends NPC { public class PrismaticImage extends NPC {
@@ -151,9 +152,9 @@ public class PrismaticImage extends NPC {
@Override @Override
public int damageRoll() { public int damageRoll() {
if (hero != null) { if (hero != null) {
return Char.combatRoll( 2 + hero.lvl/4, 4 + hero.lvl/2 ); return Random.NormalIntRange( 2 + hero.lvl/4, 4 + hero.lvl/2 );
} else { } else {
return Char.combatRoll( 2, 4 ); return Random.NormalIntRange( 2, 4 );
} }
} }
@@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
abstract public class KindOfWeapon extends EquipableItem { abstract public class KindOfWeapon extends EquipableItem {
@@ -232,7 +233,11 @@ abstract public class KindOfWeapon extends EquipableItem {
abstract public int max(int lvl); abstract public int max(int lvl);
public int damageRoll( Char owner ) { public int damageRoll( Char owner ) {
return Char.combatRoll( min(), max() ); if (owner instanceof Hero){
return Hero.heroDamageIntRange(min(), max());
} else {
return Random.NormalIntRange(min(), max());
}
} }
public float accuracyFactor( Char owner, Char target ) { public float accuracyFactor( Char owner, Char target ) {
@@ -61,6 +61,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Holy
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.DisintegrationTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.DisintegrationTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.GrimTrap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.GrimTrap;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.watabou.utils.Random;
import java.util.HashSet; import java.util.HashSet;
@@ -130,7 +131,7 @@ public class AntiMagic extends Armor.Glyph {
} }
public static int drRoll( Char ch, int level ){ public static int drRoll( Char ch, int level ){
return Char.combatRoll( return Random.NormalIntRange(
Math.round(level * genericProcChanceMultiplier(ch)), Math.round(level * genericProcChanceMultiplier(ch)),
Math.round((3 + (level*1.5f)) * genericProcChanceMultiplier(ch))); Math.round((3 + (level*1.5f)) * genericProcChanceMultiplier(ch)));
} }
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Random;
public class CapeOfThorns extends Artifact { public class CapeOfThorns extends Artifact {
@@ -100,7 +101,7 @@ public class CapeOfThorns extends Artifact {
} }
if (cooldown != 0){ if (cooldown != 0){
int deflected = Char.combatRoll(0, damage); int deflected = Random.NormalIntRange(0, damage);
damage -= deflected; damage -= deflected;
if (attacker != null && Dungeon.level.adjacent(attacker.pos, defender.pos)) { if (attacker != null && Dungeon.level.adjacent(attacker.pos, defender.pos)) {
@@ -634,7 +634,7 @@ public class DriedRose extends Artifact {
if (rose != null && rose.weapon != null){ if (rose != null && rose.weapon != null){
dmg += rose.weapon.damageRoll(this); dmg += rose.weapon.damageRoll(this);
} else { } else {
dmg += Char.combatRoll(0, 5); dmg += Random.NormalIntRange(0, 5);
} }
return dmg; return dmg;
@@ -720,10 +720,10 @@ public class DriedRose extends Artifact {
public int drRoll() { public int drRoll() {
int dr = super.drRoll(); int dr = super.drRoll();
if (rose != null && rose.armor != null){ if (rose != null && rose.armor != null){
dr += Char.combatRoll( rose.armor.DRMin(), rose.armor.DRMax()); dr += Random.NormalIntRange( rose.armor.DRMin(), rose.armor.DRMax());
} }
if (rose != null && rose.weapon != null){ if (rose != null && rose.weapon != null){
dr += Char.combatRoll( 0, rose.weapon.defenseFactor( this )); dr += Random.NormalIntRange( 0, rose.weapon.defenseFactor( this ));
} }
return dr; return dr;
} }
@@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
@@ -80,7 +81,7 @@ public class ArcaneBomb extends Bomb {
for (Char ch : affected){ for (Char ch : affected){
// 100%/83%/67% bomb damage based on distance, but pierces armor. // 100%/83%/67% bomb damage based on distance, but pierces armor.
int damage = Math.round(Char.combatRoll( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 )); int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 ));
float multiplier = 1f - (.16667f*Dungeon.level.distance(cell, ch.pos)); float multiplier = 1f - (.16667f*Dungeon.level.distance(cell, ch.pos));
ch.damage(Math.round(damage*multiplier), this); ch.damage(Math.round(damage*multiplier), this);
if (ch == Dungeon.hero && !ch.isAlive()){ if (ch == Dungeon.hero && !ch.isAlive()){
@@ -184,7 +184,7 @@ public class Bomb extends Item {
continue; continue;
} }
int dmg = Char.combatRoll(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth()*2); int dmg = Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth()*2);
//those not at the center of the blast take less damage //those not at the center of the blast take less damage
if (ch.pos != cell){ if (ch.pos != cell){
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
@@ -67,7 +68,7 @@ public class HolyBomb extends Bomb {
ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 ); ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
//bomb deals an additional 50% damage to unholy enemies in a 5x5 range //bomb deals an additional 50% damage to unholy enemies in a 5x5 range
int damage = Math.round(Char.combatRoll( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 ) * 0.5f); int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 ) * 0.5f);
ch.damage(damage, new HolyDamage()); ch.damage(damage, new HolyDamage());
} }
} }
@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.BArray; import com.watabou.utils.BArray;
import com.watabou.utils.PathFinder; import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
@@ -70,7 +71,7 @@ public class ShockBomb extends Bomb {
int power = 16 - 4*Dungeon.level.distance(ch.pos, cell); int power = 16 - 4*Dungeon.level.distance(ch.pos, cell);
if (power > 0){ if (power > 0){
//32% to 8% regular bomb damage //32% to 8% regular bomb damage
int damage = Math.round(Char.combatRoll(5 + Dungeon.scalingDepth(), 10 + 2*Dungeon.scalingDepth()) * (power/50f)); int damage = Math.round(Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + 2*Dungeon.scalingDepth()) * (power/50f));
ch.damage(damage, this); ch.damage(damage, this);
if (ch.isAlive()) Buff.prolong(ch, Paralysis.class, power); if (ch.isAlive()) Buff.prolong(ch, Paralysis.class, power);
arcs.add(new Lightning.Arc(DungeonTilemap.tileCenterToWorld(cell), ch.sprite.center())); arcs.add(new Lightning.Arc(DungeonTilemap.tileCenterToWorld(cell), ch.sprite.center()));
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster; import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Point; import com.watabou.utils.Point;
import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
@@ -67,7 +68,7 @@ public class ShrapnelBomb extends Bomb {
for (Char ch : affected){ for (Char ch : affected){
//regular bomb damage, which falls off at a rate of 5% per tile of distance //regular bomb damage, which falls off at a rate of 5% per tile of distance
int damage = Math.round(Char.combatRoll( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 )); int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 ));
damage = Math.round(damage * (1f - .05f*Dungeon.level.distance(cell, ch.pos))); damage = Math.round(damage * (1f - .05f*Dungeon.level.distance(cell, ch.pos)));
damage -= ch.drRoll(); damage -= ch.drRoll();
ch.damage(damage, this); ch.damage(damage, this);
@@ -81,7 +81,7 @@ public class RingOfForce extends Ring {
&& hero.buff(MonkEnergy.MonkAbility.UnarmedAbilityTracker.class) == null) { && hero.buff(MonkEnergy.MonkAbility.UnarmedAbilityTracker.class) == null) {
int level = getBuffedBonus(hero, Force.class); int level = getBuffedBonus(hero, Force.class);
float tier = tier(hero.STR()); float tier = tier(hero.STR());
int dmg = Char.combatRoll(min(level, tier), max(level, tier)); int dmg = Hero.heroDamageIntRange(min(level, tier), max(level, tier));
if (hero.buff(BrawlersStance.class) != null if (hero.buff(BrawlersStance.class) != null
&& hero.buff(BrawlersStance.class).active){ && hero.buff(BrawlersStance.class).active){
// 1+tier base dmg, roughly +35% dmg // 1+tier base dmg, roughly +35% dmg
@@ -91,7 +91,7 @@ public class RingOfForce extends Ring {
return dmg; return dmg;
} else { } else {
//attack without any ring of force influence //attack without any ring of force influence
return Char.combatRoll(1, Math.max(hero.STR()-8, 1)); return Hero.heroDamageIntRange(1, Math.max(hero.STR()-8, 1));
} }
} }
@@ -33,8 +33,8 @@ public class ThirteenLeafClover extends Trinket {
@Override @Override
protected int upgradeEnergyCost() { protected int upgradeEnergyCost() {
//5 -> 2(7) -> 3(10) -> 5(15) //5 -> 5(10) -> 7(17) -> 8(25)
return 2 + Math.round(level()*1.33f); return Math.round(5+1.67f*level());
} }
@Override @Override
@@ -23,8 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WandEmpower; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WandEmpower;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
@@ -49,7 +49,7 @@ public abstract class DamageWand extends Wand{
} }
public int damageRoll(int lvl){ public int damageRoll(int lvl){
int dmg = Char.combatRoll(min(lvl), max(lvl)); int dmg = Hero.heroDamageIntRange(min(lvl), max(lvl));
WandEmpower emp = Dungeon.hero.buff(WandEmpower.class); WandEmpower emp = Dungeon.hero.buff(WandEmpower.class);
if (emp != null){ if (emp != null){
dmg += emp.dmgBoost; dmg += emp.dmgBoost;
@@ -159,7 +159,7 @@ public class WandOfBlastWave extends DamageWand {
int oldPos = ch.pos; int oldPos = ch.pos;
ch.pos = newPos; ch.pos = newPos;
if (finalCollided && ch.isActive()) { if (finalCollided && ch.isActive()) {
ch.damage(Char.combatRoll(finalDist, 2*finalDist), new Knockback()); ch.damage(Random.NormalIntRange(finalDist, 2*finalDist), new Knockback());
if (ch.isActive()) { if (ch.isActive()) {
Paralysis.prolong(ch, Paralysis.class, 1 + finalDist/2f); Paralysis.prolong(ch, Paralysis.class, 1 + finalDist/2f);
} else if (ch == Dungeon.hero){ } else if (ch == Dungeon.hero){
@@ -367,16 +367,16 @@ public class WandOfLivingEarth extends DamageWand {
@Override @Override
public int damageRoll() { public int damageRoll() {
return Char.combatRoll(2, 4 + Dungeon.scalingDepth()/2); return Random.NormalIntRange(2, 4 + Dungeon.scalingDepth()/2);
} }
@Override @Override
public int drRoll() { public int drRoll() {
int dr = super.drRoll(); int dr = super.drRoll();
if (Dungeon.isChallenged(Challenges.NO_ARMOR)){ if (Dungeon.isChallenged(Challenges.NO_ARMOR)){
return dr + Char.combatRoll(wandLevel, 2 + wandLevel); return dr + Random.NormalIntRange(wandLevel, 2 + wandLevel);
} else { } else {
return dr + Char.combatRoll(wandLevel, 3 + 3 * wandLevel); return dr + Random.NormalIntRange(wandLevel, 3 + 3 * wandLevel);
} }
} }
@@ -322,7 +322,7 @@ public class WandOfWarding extends Wand {
public int drRoll() { public int drRoll() {
int dr = super.drRoll(); int dr = super.drRoll();
if (tier > 3){ if (tier > 3){
return dr + Math.round(Char.combatRoll(0, 3 + Dungeon.scalingDepth()/2) / (7f - tier)); return dr + Math.round(Random.NormalIntRange(0, 3 + Dungeon.scalingDepth()/2) / (7f - tier));
} else { } else {
return dr; return dr;
} }
@@ -349,7 +349,7 @@ public class WandOfWarding extends Wand {
spend( 1f ); spend( 1f );
//always hits //always hits
int dmg = Char.combatRoll( 2 + wandLevel, 8 + 4*wandLevel ); int dmg = Hero.heroDamageIntRange( 2 + wandLevel, 8 + 4*wandLevel );
Char enemy = this.enemy; Char enemy = this.enemy;
enemy.damage( dmg, this ); enemy.damage( dmg, this );
if (enemy.isAlive()){ if (enemy.isAlive()){
@@ -214,7 +214,7 @@ public class SpiritBow extends Weapon {
if (owner instanceof Hero) { if (owner instanceof Hero) {
int exStr = ((Hero)owner).STR() - STRReq(); int exStr = ((Hero)owner).STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll( 0, exStr ); damage += Hero.heroDamageIntRange( 0, exStr );
} }
} }
@@ -53,7 +53,7 @@ public class Blazing extends Weapon.Enchantment {
} }
if (powerMulti > 0){ if (powerMulti > 0){
int burnDamage = Char.combatRoll( 1, 3 + Dungeon.scalingDepth()/4 ); int burnDamage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 );
burnDamage = Math.round(burnDamage * 0.67f * powerMulti); burnDamage = Math.round(burnDamage * 0.67f * powerMulti);
if (burnDamage > 0) { if (burnDamage > 0) {
defender.damage(burnDamage, this); defender.damage(burnDamage, this);
@@ -52,12 +52,12 @@ public class AssassinsBlade extends MeleeWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 50% toward max to max on surprise, instead of min to max. //deals 50% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = augment.damageFactor(Char.combatRoll( int damage = augment.damageFactor(Hero.heroDamageIntRange(
min() + Math.round(diff*0.50f), min() + Math.round(diff*0.50f),
max())); max()));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll(0, exStr); damage += Hero.heroDamageIntRange(0, exStr);
} }
return damage; return damage;
} }
@@ -66,12 +66,12 @@ public class Dagger extends MeleeWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 75% toward max to max on surprise, instead of min to max. //deals 75% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = augment.damageFactor(Char.combatRoll( int damage = augment.damageFactor(Hero.heroDamageIntRange(
min() + Math.round(diff*0.75f), min() + Math.round(diff*0.75f),
max())); max()));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll(0, exStr); damage += Hero.heroDamageIntRange(0, exStr);
} }
return damage; return damage;
} }
@@ -52,12 +52,12 @@ public class Dirk extends MeleeWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 67% toward max to max on surprise, instead of min to max. //deals 67% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = augment.damageFactor(Char.combatRoll( int damage = augment.damageFactor(Hero.heroDamageIntRange(
min() + Math.round(diff*0.67f), min() + Math.round(diff*0.67f),
max())); max()));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll(0, exStr); damage += Hero.heroDamageIntRange(0, exStr);
} }
return damage; return damage;
} }
@@ -324,7 +324,7 @@ public class MeleeWeapon extends Weapon {
if (owner instanceof Hero) { if (owner instanceof Hero) {
int exStr = ((Hero)owner).STR() - STRReq(); int exStr = ((Hero)owner).STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll( 0, exStr ); damage += Hero.heroDamageIntRange( 0, exStr );
} }
} }
return damage; return damage;
@@ -54,12 +54,12 @@ public class Kunai extends MissileWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 60% toward max to max on surprise, instead of min to max. //deals 60% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = augment.damageFactor(Char.combatRoll( int damage = augment.damageFactor(Hero.heroDamageIntRange(
min() + Math.round(diff*0.6f), min() + Math.round(diff*0.6f),
max())); max()));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll(0, exStr); damage += Hero.heroDamageIntRange(0, exStr);
} }
return damage; return damage;
} }
@@ -390,7 +390,7 @@ abstract public class MissileWeapon extends Weapon {
if (owner instanceof Hero) { if (owner instanceof Hero) {
int exStr = ((Hero)owner).STR() - STRReq(); int exStr = ((Hero)owner).STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll( 0, exStr ); damage += Hero.heroDamageIntRange( 0, exStr );
} }
if (owner.buff(Momentum.class) != null && owner.buff(Momentum.class).freerunning()) { if (owner.buff(Momentum.class) != null && owner.buff(Momentum.class).freerunning()) {
damage = Math.round(damage * (1f + 0.15f * ((Hero) owner).pointsInTalent(Talent.PROJECTILE_MOMENTUM))); damage = Math.round(damage * (1f + 0.15f * ((Hero) owner).pointsInTalent(Talent.PROJECTILE_MOMENTUM)));
@@ -54,12 +54,12 @@ public class ThrowingKnife extends MissileWeapon {
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) { if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
//deals 75% toward max to max on surprise, instead of min to max. //deals 75% toward max to max on surprise, instead of min to max.
int diff = max() - min(); int diff = max() - min();
int damage = augment.damageFactor(Char.combatRoll( int damage = augment.damageFactor(Hero.heroDamageIntRange(
min() + Math.round(diff*0.75f), min() + Math.round(diff*0.75f),
max())); max()));
int exStr = hero.STR() - STRReq(); int exStr = hero.STR() - STRReq();
if (exStr > 0) { if (exStr > 0) {
damage += Char.combatRoll(0, exStr); damage += Hero.heroDamageIntRange(0, exStr);
} }
return damage; return damage;
} }
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Random;
public class HolyDart extends TippedDart { public class HolyDart extends TippedDart {
@@ -52,7 +53,7 @@ public class HolyDart extends TippedDart {
if (Char.hasProp(defender, Char.Property.UNDEAD) || Char.hasProp(defender, Char.Property.DEMONIC)){ if (Char.hasProp(defender, Char.Property.UNDEAD) || Char.hasProp(defender, Char.Property.DEMONIC)){
defender.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+buffedLvl() ); defender.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+buffedLvl() );
Sample.INSTANCE.play(Assets.Sounds.BURNING); Sample.INSTANCE.play(Assets.Sounds.BURNING);
defender.damage(Char.combatRoll(10 + Dungeon.scalingDepth()/3, 20 + Dungeon.scalingDepth()/3), this); defender.damage(Random.NormalIntRange(10 + Dungeon.scalingDepth()/3, 20 + Dungeon.scalingDepth()/3), this);
//also do not bless enemies if processing charged shot //also do not bless enemies if processing charged shot
} else if (!processingChargedShot){ } else if (!processingChargedShot){
Buff.affect(defender, Bless.class, Math.round(Bless.DURATION)); Buff.affect(defender, Bless.class, Math.round(Bless.DURATION));
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PointF; import com.watabou.utils.PointF;
import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
@@ -44,7 +45,7 @@ public class ShockingDart extends TippedDart {
//when processing charged shot, only shock enemies //when processing charged shot, only shock enemies
if (!processingChargedShot || attacker.alignment != defender.alignment) { if (!processingChargedShot || attacker.alignment != defender.alignment) {
defender.damage(Char.combatRoll(5 + Dungeon.scalingDepth() / 4, 10 + Dungeon.scalingDepth() / 4), new Electricity()); defender.damage(Random.NormalIntRange(5 + Dungeon.scalingDepth() / 4, 10 + Dungeon.scalingDepth() / 4), new Electricity());
CharSprite s = defender.sprite; CharSprite s = defender.sprite;
if (s != null && s.parent != null) { if (s != null && s.parent != null) {
@@ -828,7 +828,7 @@ public class CavesBossLevel extends Level {
Char ch = Actor.findChar(cell); Char ch = Actor.findChar(cell);
if (ch != null && !(ch instanceof DM300) && !ch.flying) { if (ch != null && !(ch instanceof DM300) && !ch.flying) {
Sample.INSTANCE.play( Assets.Sounds.LIGHTNING ); Sample.INSTANCE.play( Assets.Sounds.LIGHTNING );
ch.damage( Char.combatRoll(6, 12), new Electricity()); ch.damage( Random.NormalIntRange(6, 12), new Electricity());
ch.sprite.flash(); ch.sprite.flash();
if (ch == Dungeon.hero){ if (ch == Dungeon.hero){
@@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.features;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
@@ -47,6 +46,7 @@ import com.watabou.noosa.Game;
import com.watabou.noosa.Image; import com.watabou.noosa.Image;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback; import com.watabou.utils.Callback;
import com.watabou.utils.Random;
public class Chasm implements Hero.Doom { public class Chasm implements Hero.Doom {
@@ -146,7 +146,7 @@ public class Chasm implements Hero.Doom {
//The lower the hero's HP, the more bleed and the less upfront damage. //The lower the hero's HP, the more bleed and the less upfront damage.
//Hero has a 50% chance to bleed out at 66% HP, and begins to risk instant-death at 25% //Hero has a 50% chance to bleed out at 66% HP, and begins to risk instant-death at 25%
Buff.affect( hero, Bleeding.class).set( Math.round(hero.HT / (6f + (6f*(hero.HP/(float)hero.HT)))), Chasm.class); Buff.affect( hero, Bleeding.class).set( Math.round(hero.HT / (6f + (6f*(hero.HP/(float)hero.HT)))), Chasm.class);
hero.damage( Math.max( hero.HP / 2, Char.combatRoll( hero.HP / 2, hero.HT / 4 )), new Chasm() ); hero.damage( Math.max( hero.HP / 2, Random.NormalIntRange( hero.HP / 2, hero.HT / 4 )), new Chasm() );
} }
public static void mobFall( Mob mob ) { public static void mobFall( Mob mob ) {
@@ -282,7 +282,7 @@ public class SentryRoom extends SpecialRoom {
public void onZapComplete(){ public void onZapComplete(){
if (hit(this, Dungeon.hero, true)) { if (hit(this, Dungeon.hero, true)) {
Dungeon.hero.damage(Char.combatRoll(2 + Dungeon.depth / 2, 4 + Dungeon.depth), new Eye.DeathGaze()); Dungeon.hero.damage(Random.NormalIntRange(2 + Dungeon.depth / 2, 4 + Dungeon.depth), new Eye.DeathGaze());
if (!Dungeon.hero.isAlive()) { if (!Dungeon.hero.isAlive()) {
Badges.validateDeathFromEnemyMagic(); Badges.validateDeathFromEnemyMagic();
Dungeon.fail(this); Dungeon.fail(this);
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Random;
public class DisintegrationTrap extends Trap { public class DisintegrationTrap extends Trap {
@@ -77,7 +78,7 @@ public class DisintegrationTrap extends Trap {
Sample.INSTANCE.play(Assets.Sounds.RAY); Sample.INSTANCE.play(Assets.Sounds.RAY);
ShatteredPixelDungeon.scene().add(new Beam.DeathRay(DungeonTilemap.tileCenterToWorld(pos), target.sprite.center())); ShatteredPixelDungeon.scene().add(new Beam.DeathRay(DungeonTilemap.tileCenterToWorld(pos), target.sprite.center()));
} }
target.damage( Char.combatRoll(30, 50) + scalingDepth(), this ); target.damage( Random.NormalIntRange(30, 50) + scalingDepth(), this );
if (target == Dungeon.hero){ if (target == Dungeon.hero){
Hero hero = (Hero)target; Hero hero = (Hero)target;
if (!hero.isAlive()){ if (!hero.isAlive()){
@@ -76,7 +76,7 @@ public class GeyserTrap extends Trap {
//does the equivalent of a bomb's damage against fiery enemies. //does the equivalent of a bomb's damage against fiery enemies.
if (Char.hasProp(ch, Char.Property.FIERY)){ if (Char.hasProp(ch, Char.Property.FIERY)){
int dmg = Char.combatRoll(5 + scalingDepth(), 10 + scalingDepth()*2); int dmg = Random.NormalIntRange(5 + scalingDepth(), 10 + scalingDepth()*2);
dmg *= 0.67f; dmg *= 0.67f;
if (!ch.isImmune(GeyserTrap.class)){ if (!ch.isImmune(GeyserTrap.class)){
ch.damage(dmg, this); ch.damage(dmg, this);
@@ -122,7 +122,7 @@ public class GeyserTrap extends Trap {
//does the equivalent of a bomb's damage against fiery enemies. //does the equivalent of a bomb's damage against fiery enemies.
if (Char.hasProp(ch, Char.Property.FIERY)){ if (Char.hasProp(ch, Char.Property.FIERY)){
int dmg = Char.combatRoll(5 + scalingDepth(), 10 + scalingDepth()*2); int dmg = Random.NormalIntRange(5 + scalingDepth(), 10 + scalingDepth()*2);
if (!ch.isImmune(GeyserTrap.class)){ if (!ch.isImmune(GeyserTrap.class)){
ch.damage(dmg, this); ch.damage(dmg, this);
} }
@@ -81,7 +81,7 @@ public class GnollRockfallTrap extends RockfallTrap {
if (ch != null && ch.isAlive() && !(ch instanceof GnollGeomancer)){ if (ch != null && ch.isAlive() && !(ch instanceof GnollGeomancer)){
//deals notably less damage than a regular rockfall trap, but ignores armor //deals notably less damage than a regular rockfall trap, but ignores armor
int damage = Char.combatRoll(6, 12); int damage = Random.NormalIntRange(6, 12);
ch.damage( Math.max(damage, 0) , this); ch.damage( Math.max(damage, 0) , this);
//guards take full paralysis, otherwise just a little //guards take full paralysis, otherwise just a little

Some files were not shown because too many files have changed in this diff Show More