v0.6.3: moved many resistances and immunities to character properties
This commit is contained in:
parent
80d19ac2d0
commit
5529239973
|
@ -23,10 +23,16 @@ package com.shatteredpixel.shatteredpixeldungeon.actors;
|
||||||
|
|
||||||
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.blobs.Blob;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.EarthImbue;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.EarthImbue;
|
||||||
|
@ -34,14 +40,24 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FireImbue;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Speed;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Speed;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Venom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLightning;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazing;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
||||||
|
@ -56,6 +72,7 @@ import com.watabou.utils.GameMath;
|
||||||
import com.watabou.utils.PathFinder;
|
import com.watabou.utils.PathFinder;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
public abstract class Char extends Actor {
|
public abstract class Char extends Actor {
|
||||||
|
@ -277,10 +294,10 @@ public abstract class Char extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<?> srcClass = src.getClass();
|
Class<?> srcClass = src.getClass();
|
||||||
if (immunities().contains( srcClass )) {
|
if (isImmune( srcClass )) {
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
} else if (resistances().contains( srcClass )) {
|
} else {
|
||||||
dmg = Random.IntRange( 0, dmg );
|
dmg = Math.round( dmg * resist( srcClass ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buff( Paralysis.class ) != null) {
|
if (buff( Paralysis.class ) != null) {
|
||||||
|
@ -493,6 +510,16 @@ public abstract class Char extends Actor {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float resist( Class effect ){
|
||||||
|
float result = 1f;
|
||||||
|
for (Class c : resistances()){
|
||||||
|
if (c.isAssignableFrom(effect)){
|
||||||
|
result *= Random.Float();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
protected final HashSet<Class> immunities = new HashSet<>();
|
protected final HashSet<Class> immunities = new HashSet<>();
|
||||||
|
|
||||||
public HashSet<Class> immunities() {
|
public HashSet<Class> immunities() {
|
||||||
|
@ -506,6 +533,15 @@ public abstract class Char extends Actor {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isImmune(Class effect ){
|
||||||
|
for (Class c : immunities()){
|
||||||
|
if (c.isAssignableFrom(effect)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected HashSet<Property> properties = new HashSet<>();
|
protected HashSet<Property> properties = new HashSet<>();
|
||||||
|
|
||||||
public HashSet<Property> properties() {
|
public HashSet<Property> properties() {
|
||||||
|
@ -513,10 +549,22 @@ public abstract class Char extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Property{
|
public enum Property{
|
||||||
BOSS,
|
BOSS ( new HashSet<Class>( Arrays.asList(Grim.class, ScrollOfPsionicBlast.class)),
|
||||||
MINIBOSS,
|
new HashSet<Class>( Arrays.asList(Corruption.class) )),
|
||||||
|
MINIBOSS ( new HashSet<Class>(),
|
||||||
|
new HashSet<Class>( Arrays.asList(Corruption.class) )),
|
||||||
UNDEAD,
|
UNDEAD,
|
||||||
DEMONIC,
|
DEMONIC,
|
||||||
|
INORGANIC ( new HashSet<Class>(),
|
||||||
|
new HashSet<Class>( Arrays.asList(Bleeding.class, ToxicGas.class, Poison.class, Venom.class) )),
|
||||||
|
BLOB_IMMUNE ( new HashSet<Class>(),
|
||||||
|
new HashSet<Class>( Arrays.asList(Blob.class) )),
|
||||||
|
FIERY ( new HashSet<Class>( Arrays.asList(WandOfFireblast.class)),
|
||||||
|
new HashSet<Class>( Arrays.asList(Burning.class, Blazing.class))),
|
||||||
|
ACIDIC ( new HashSet<Class>( Arrays.asList(ToxicGas.class)),
|
||||||
|
new HashSet<Class>( Arrays.asList(Ooze.class))),
|
||||||
|
ELECTRIC ( new HashSet<Class>( Arrays.asList(WandOfLightning.class, Shocking.class, Potential.class, Electricity.class)),
|
||||||
|
new HashSet<Class>()),
|
||||||
IMMOVABLE;
|
IMMOVABLE;
|
||||||
|
|
||||||
private HashSet<Class> resistances;
|
private HashSet<Class> resistances;
|
||||||
|
|
|
@ -43,8 +43,9 @@ public class ConfusionGas extends Blob {
|
||||||
for (int j = area.top; j < area.bottom; j++){
|
for (int j = area.top; j < area.bottom; j++){
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
||||||
if (!ch.immunities().contains(this.getClass()))
|
if (!ch.isImmune(this.getClass())) {
|
||||||
Buff.prolong( ch, Vertigo.class, 2 );
|
Buff.prolong(ch, Vertigo.class, 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class Electricity extends Blob {
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (cur[cell] > 0) {
|
if (cur[cell] > 0) {
|
||||||
Char ch = Actor.findChar( cell );
|
Char ch = Actor.findChar( cell );
|
||||||
if (ch != null && !ch.immunities().contains(this.getClass())) {
|
if (ch != null && !ch.isImmune(this.getClass())) {
|
||||||
Buff.prolong( ch, Paralysis.class, 1f);
|
Buff.prolong( ch, Paralysis.class, 1f);
|
||||||
if (cur[cell] % 2 == 1) {
|
if (cur[cell] % 2 == 1) {
|
||||||
ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this);
|
ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this);
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class Fire extends Blob {
|
||||||
|
|
||||||
private void burn( int pos ) {
|
private void burn( int pos ) {
|
||||||
Char ch = Actor.findChar( pos );
|
Char ch = Actor.findChar( pos );
|
||||||
if (ch != null && !ch.immunities().contains(this.getClass())) {
|
if (ch != null && !ch.isImmune(this.getClass())) {
|
||||||
Buff.affect( ch, Burning.class ).reignite( ch );
|
Buff.affect( ch, Burning.class ).reignite( ch );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class Freezing extends Blob {
|
||||||
}
|
}
|
||||||
|
|
||||||
Char ch = Actor.findChar( cell );
|
Char ch = Actor.findChar( cell );
|
||||||
if (ch != null && !ch.immunities().contains(this.getClass())) {
|
if (ch != null && !ch.isImmune(this.getClass())) {
|
||||||
if (ch.buff(Frost.class) != null){
|
if (ch.buff(Frost.class) != null){
|
||||||
Buff.affect(ch, Frost.class, 2f);
|
Buff.affect(ch, Frost.class, 2f);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class ParalyticGas extends Blob {
|
||||||
for (int j = area.top; j < area.bottom; j++) {
|
for (int j = area.top; j < area.bottom; j++) {
|
||||||
cell = i + j * Dungeon.level.width();
|
cell = i + j * Dungeon.level.width();
|
||||||
if (cur[cell] > 0 && (ch = Actor.findChar(cell)) != null) {
|
if (cur[cell] > 0 && (ch = Actor.findChar(cell)) != null) {
|
||||||
if (!ch.immunities().contains(this.getClass()))
|
if (!ch.isImmune(this.getClass()))
|
||||||
Buff.prolong(ch, Paralysis.class, Paralysis.duration(ch));
|
Buff.prolong(ch, Paralysis.class, Paralysis.duration(ch));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class Regrowth extends Blob {
|
||||||
|
|
||||||
Char ch = Actor.findChar( cell );
|
Char ch = Actor.findChar( cell );
|
||||||
if (ch != null
|
if (ch != null
|
||||||
&& !ch.immunities().contains(this.getClass())
|
&& !ch.isImmune(this.getClass())
|
||||||
&& off[cell] > 1) {
|
&& off[cell] > 1) {
|
||||||
Buff.prolong( ch, Roots.class, TICK );
|
Buff.prolong( ch, Roots.class, TICK );
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class StenchGas extends Blob {
|
||||||
for (int j = area.top; j < area.bottom; j++){
|
for (int j = area.top; j < area.bottom; j++){
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
||||||
if (!ch.immunities().contains(this.getClass()))
|
if (!ch.isImmune(this.getClass()))
|
||||||
Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch )/5 );
|
Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch )/5 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class ToxicGas extends Blob implements Hero.Doom {
|
||||||
for (int j = area.top; j < area.bottom; j++){
|
for (int j = area.top; j < area.bottom; j++){
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
||||||
if (!ch.immunities().contains(this.getClass())) {
|
if (!ch.isImmune(this.getClass())) {
|
||||||
|
|
||||||
int damage = (ch.HT + levelDamage) / 40;
|
int damage = (ch.HT + levelDamage) / 40;
|
||||||
if (Random.Int( 40 ) < (ch.HT + levelDamage) % 40) {
|
if (Random.Int( 40 ) < (ch.HT + levelDamage) % 40) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class VenomGas extends Blob {
|
||||||
for (int j = area.top; j < area.bottom; j++){
|
for (int j = area.top; j < area.bottom; j++){
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
if (cur[cell] > 0 && (ch = Actor.findChar( cell )) != null) {
|
||||||
if (!ch.immunities().contains(this.getClass()))
|
if (!ch.isImmune(this.getClass()))
|
||||||
Buff.affect(ch, Venom.class).set(2f, strength);
|
Buff.affect(ch, Venom.class).set(2f, strength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class Web extends Blob {
|
||||||
volume += off[cell];
|
volume += off[cell];
|
||||||
|
|
||||||
Char ch = Actor.findChar( cell );
|
Char ch = Actor.findChar( cell );
|
||||||
if (ch != null && !ch.immunities().contains(this.getClass())) {
|
if (ch != null && !ch.isImmune(this.getClass())) {
|
||||||
Buff.prolong( ch, Roots.class, TICK );
|
Buff.prolong( ch, Roots.class, TICK );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||||
|
@ -55,16 +56,7 @@ public class BlobImmunity extends FlavourBuff {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( ParalyticGas.class );
|
immunities.add( Blob.class );
|
||||||
immunities.add( ToxicGas.class );
|
|
||||||
immunities.add( ConfusionGas.class );
|
|
||||||
immunities.add( StenchGas.class );
|
|
||||||
immunities.add( VenomGas.class );
|
|
||||||
immunities.add( Fire.class );
|
|
||||||
immunities.add( Freezing.class );
|
|
||||||
immunities.add( Electricity.class );
|
|
||||||
immunities.add( Regrowth.class );
|
|
||||||
immunities.add( Web.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class Buff extends Actor {
|
||||||
|
|
||||||
public boolean attachTo( Char target ) {
|
public boolean attachTo( Char target ) {
|
||||||
|
|
||||||
if (target.immunities().contains( getClass() )) {
|
if (target.isImmune( getClass() )) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class Drowsy extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean attachTo( Char target ) {
|
public boolean attachTo( Char target ) {
|
||||||
if (!target.immunities().contains(Sleep.class) && super.attachTo(target)) {
|
if (!target.isImmune(Sleep.class) && super.attachTo(target)) {
|
||||||
if (cooldown() == 0)
|
if (cooldown() == 0)
|
||||||
spend(Random.Int(3, 6));
|
spend(Random.Int(3, 6));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class MagicalSleep extends Buff {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean attachTo( Char target ) {
|
public boolean attachTo( Char target ) {
|
||||||
if (!target.immunities().contains(Sleep.class) && super.attachTo( target )) {
|
if (!target.isImmune(Sleep.class) && super.attachTo( target )) {
|
||||||
|
|
||||||
if (target instanceof Hero)
|
if (target instanceof Hero)
|
||||||
if (target.HP == target.HT) {
|
if (target.HP == target.HT) {
|
||||||
|
|
|
@ -93,5 +93,6 @@ public class ToxicImbue extends Buff {
|
||||||
{
|
{
|
||||||
immunities.add( ToxicGas.class );
|
immunities.add( ToxicGas.class );
|
||||||
immunities.add( Poison.class );
|
immunities.add( Poison.class );
|
||||||
|
immunities.add( Venom.class );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class Acidic extends Scorpio {
|
||||||
|
|
||||||
{
|
{
|
||||||
spriteClass = AcidicSprite.class;
|
spriteClass = AcidicSprite.class;
|
||||||
|
|
||||||
|
properties.add(Property.ACIDIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,7 +89,4 @@ public class Bat extends Mob {
|
||||||
return super.createLoot();
|
return super.createLoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( Vampiric.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class DM300 extends Mob {
|
||||||
lootChance = 0.333f;
|
lootChance = 0.333f;
|
||||||
|
|
||||||
properties.add(Property.BOSS);
|
properties.add(Property.BOSS);
|
||||||
|
properties.add(Property.INORGANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -136,7 +137,7 @@ public class DM300 extends Mob {
|
||||||
public void damage(int dmg, Object src) {
|
public void damage(int dmg, Object src) {
|
||||||
super.damage(dmg, src);
|
super.damage(dmg, src);
|
||||||
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
||||||
if (lock != null && !immunities().contains(src.getClass())) lock.addTime(dmg*1.5f);
|
if (lock != null && !isImmune(src.getClass())) lock.addTime(dmg*1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -164,11 +165,6 @@ public class DM300 extends Mob {
|
||||||
yell( Messages.get(this, "notice") );
|
yell( Messages.get(this, "notice") );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( Grim.class );
|
|
||||||
resistances.add( ScrollOfPsionicBlast.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( ToxicGas.class );
|
immunities.add( ToxicGas.class );
|
||||||
immunities.add( Terror.class );
|
immunities.add( Terror.class );
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class Elemental extends Mob {
|
||||||
loot = new PotionOfLiquidFlame();
|
loot = new PotionOfLiquidFlame();
|
||||||
lootChance = 0.1f;
|
lootChance = 0.1f;
|
||||||
|
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.FIERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,12 +80,7 @@ public class Elemental extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add( Buff buff ) {
|
public void add( Buff buff ) {
|
||||||
if (buff instanceof Burning) {
|
if (buff instanceof Frost || buff instanceof Chill) {
|
||||||
if (HP < HT) {
|
|
||||||
HP++;
|
|
||||||
sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
|
||||||
}
|
|
||||||
} else if (buff instanceof Frost || buff instanceof Chill) {
|
|
||||||
if (Dungeon.level.water[this.pos])
|
if (Dungeon.level.water[this.pos])
|
||||||
damage( Random.NormalIntRange( HT / 2, HT ), buff );
|
damage( Random.NormalIntRange( HT / 2, HT ), buff );
|
||||||
else
|
else
|
||||||
|
@ -95,9 +90,4 @@ public class Elemental extends Mob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
immunities.add( Burning.class );
|
|
||||||
immunities.add( Blazing.class );
|
|
||||||
immunities.add( WandOfFireblast.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,6 @@ public class Eye extends Mob {
|
||||||
{
|
{
|
||||||
resistances.add( WandOfDisintegration.class );
|
resistances.add( WandOfDisintegration.class );
|
||||||
resistances.add( Grim.class );
|
resistances.add( Grim.class );
|
||||||
resistances.add( Vampiric.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,8 @@ public class Golem extends Mob {
|
||||||
|
|
||||||
EXP = 12;
|
EXP = 12;
|
||||||
maxLvl = 22;
|
maxLvl = 22;
|
||||||
|
|
||||||
|
properties.add(Property.INORGANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class Goo extends Mob {
|
||||||
|
|
||||||
properties.add(Property.BOSS);
|
properties.add(Property.BOSS);
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.DEMONIC);
|
||||||
|
properties.add(Property.ACIDIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int pumpedUp = 0;
|
private int pumpedUp = 0;
|
||||||
|
@ -271,9 +272,4 @@ public class Goo extends Mob {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( ToxicGas.class );
|
|
||||||
resistances.add( Grim.class );
|
|
||||||
resistances.add( ScrollOfPsionicBlast.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class Guard extends Mob {
|
||||||
loot = null; //see createloot.
|
loot = null; //see createloot.
|
||||||
lootChance = 0.25f;
|
lootChance = 0.25f;
|
||||||
|
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.UNDEAD);
|
||||||
|
|
||||||
HUNTING = new Hunting();
|
HUNTING = new Hunting();
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,9 +228,6 @@ public class King extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
resistances.add( ToxicGas.class );
|
|
||||||
resistances.add( Grim.class );
|
|
||||||
resistances.add( ScrollOfPsionicBlast.class );
|
|
||||||
resistances.add( WandOfDisintegration.class );
|
resistances.add( WandOfDisintegration.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,6 +252,7 @@ public class King extends Mob {
|
||||||
state = WANDERING;
|
state = WANDERING;
|
||||||
|
|
||||||
properties.add(Property.UNDEAD);
|
properties.add(Property.UNDEAD);
|
||||||
|
properties.add(Property.INORGANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,6 +51,8 @@ public class Piranha extends Mob {
|
||||||
lootChance = 1f;
|
lootChance = 1f;
|
||||||
|
|
||||||
HUNTING = new Hunting();
|
HUNTING = new Hunting();
|
||||||
|
|
||||||
|
properties.add(Property.BLOB_IMMUNE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Piranha() {
|
public Piranha() {
|
||||||
|
@ -133,11 +135,6 @@ public class Piranha extends Mob {
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Burning.class );
|
immunities.add( Burning.class );
|
||||||
immunities.add( Paralysis.class );
|
|
||||||
immunities.add( ToxicGas.class );
|
|
||||||
immunities.add( VenomGas.class );
|
|
||||||
immunities.add( Roots.class );
|
|
||||||
immunities.add( Frost.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Hunting extends Mob.Hunting{
|
private class Hunting extends Mob.Hunting{
|
||||||
|
|
|
@ -104,8 +104,4 @@ public class Scorpio extends Mob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( Vampiric.class );
|
|
||||||
resistances.add( Poison.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,8 @@ public class Shaman extends Mob implements Callback {
|
||||||
|
|
||||||
loot = Generator.Category.SCROLL;
|
loot = Generator.Category.SCROLL;
|
||||||
lootChance = 0.33f;
|
lootChance = 0.33f;
|
||||||
|
|
||||||
|
properties.add(Property.ELECTRIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,9 +124,4 @@ public class Shaman extends Mob implements Callback {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( WandOfLightning.class );
|
|
||||||
resistances.add( Shocking.class );
|
|
||||||
resistances.add( Potential.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class Skeleton extends Mob {
|
||||||
lootChance = 0.2f;
|
lootChance = 0.2f;
|
||||||
|
|
||||||
properties.add(Property.UNDEAD);
|
properties.add(Property.UNDEAD);
|
||||||
|
properties.add(Property.INORGANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class Spinner extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add(Roots.class);
|
immunities.add(Web.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Fleeing extends Mob.Fleeing {
|
private class Fleeing extends Mob.Fleeing {
|
||||||
|
|
|
@ -43,6 +43,8 @@ public class Statue extends Mob {
|
||||||
|
|
||||||
EXP = 0;
|
EXP = 0;
|
||||||
state = PASSIVE;
|
state = PASSIVE;
|
||||||
|
|
||||||
|
properties.add(Property.INORGANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Weapon weapon;
|
protected Weapon weapon;
|
||||||
|
@ -153,12 +155,7 @@ public class Statue extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
resistances.add(ToxicGas.class);
|
|
||||||
resistances.add(Poison.class);
|
|
||||||
resistances.add(Grim.class);
|
resistances.add(Grim.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
immunities.add( Vampiric.class );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,10 +137,6 @@ public class Succubus extends Mob {
|
||||||
return Random.NormalIntRange(0, 10);
|
return Random.NormalIntRange(0, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( Vampiric.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Sleep.class );
|
immunities.add( Sleep.class );
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,8 +237,6 @@ public class Tengu extends Mob {
|
||||||
{
|
{
|
||||||
resistances.add( ToxicGas.class );
|
resistances.add( ToxicGas.class );
|
||||||
resistances.add( Poison.class );
|
resistances.add( Poison.class );
|
||||||
resistances.add( Grim.class );
|
|
||||||
resistances.add( ScrollOfPsionicBlast.class );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class Thief extends Mob {
|
||||||
WANDERING = new Wandering();
|
WANDERING = new Wandering();
|
||||||
FLEEING = new Fleeing();
|
FLEEING = new Fleeing();
|
||||||
|
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.UNDEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String ITEM = "item";
|
private static final String ITEM = "item";
|
||||||
|
|
|
@ -216,6 +216,7 @@ public class Yog extends Mob {
|
||||||
|
|
||||||
properties.add(Property.BOSS);
|
properties.add(Property.BOSS);
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.DEMONIC);
|
||||||
|
properties.add(Property.ACIDIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -263,12 +264,6 @@ public class Yog extends Mob {
|
||||||
if (lock != null) lock.addTime(dmg*0.5f);
|
if (lock != null) lock.addTime(dmg*0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
resistances.add( ToxicGas.class );
|
|
||||||
resistances.add( Grim.class );
|
|
||||||
resistances.add( ScrollOfPsionicBlast.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Amok.class );
|
immunities.add( Amok.class );
|
||||||
immunities.add( Sleep.class );
|
immunities.add( Sleep.class );
|
||||||
|
@ -292,6 +287,7 @@ public class Yog extends Mob {
|
||||||
|
|
||||||
properties.add(Property.BOSS);
|
properties.add(Property.BOSS);
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.DEMONIC);
|
||||||
|
properties.add(Property.FIERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -363,16 +359,12 @@ public class Yog extends Mob {
|
||||||
|
|
||||||
{
|
{
|
||||||
resistances.add( ToxicGas.class );
|
resistances.add( ToxicGas.class );
|
||||||
resistances.add( Grim.class );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Amok.class );
|
immunities.add( Amok.class );
|
||||||
immunities.add( Sleep.class );
|
immunities.add( Sleep.class );
|
||||||
immunities.add( Terror.class );
|
immunities.add( Terror.class );
|
||||||
immunities.add( Burning.class );
|
|
||||||
immunities.add( ScrollOfPsionicBlast.class );
|
|
||||||
immunities.add( Vertigo.class );
|
immunities.add( Vertigo.class );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,6 +385,8 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
//before other mobs
|
//before other mobs
|
||||||
actPriority = MOB_PRIO + 1;
|
actPriority = MOB_PRIO + 1;
|
||||||
|
|
||||||
|
properties.add(Property.UNDEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DriedRose rose = null;
|
private DriedRose rose = null;
|
||||||
|
|
|
@ -69,8 +69,5 @@ public class RingOfElements extends Ring {
|
||||||
|
|
||||||
public class Resistance extends RingBuff {
|
public class Resistance extends RingBuff {
|
||||||
|
|
||||||
public float durationFactor() {
|
|
||||||
return level() < 0 ? 1 : (1 + 0.5f * level()) / (1 + level());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Statue;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Swarm;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Swarm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Yog;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Yog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
|
@ -194,7 +193,7 @@ public class WandOfCorruption extends Wand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Class<?extends Buff> toAssign : debuffs.keySet()){
|
for (Class<?extends Buff> toAssign : debuffs.keySet()){
|
||||||
if (debuffs.get(toAssign) > 0 && enemy.immunities().contains(toAssign)){
|
if (debuffs.get(toAssign) > 0 && enemy.isImmune(toAssign)){
|
||||||
debuffs.put(toAssign, 0f);
|
debuffs.put(toAssign, 0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,9 +217,7 @@ public class WandOfCorruption extends Wand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enemy.properties().contains(Char.Property.BOSS) &&
|
if (!enemy.isImmune(Corruption.class)){
|
||||||
!enemy.properties().contains(Char.Property.MINIBOSS) &&
|
|
||||||
!enemy.immunities().contains(Corruption.class)){
|
|
||||||
enemy.HP = enemy.HT;
|
enemy.HP = enemy.HT;
|
||||||
for (Buff buff : enemy.buffs()) {
|
for (Buff buff : enemy.buffs()) {
|
||||||
if (buff.type == Buff.buffType.NEGATIVE
|
if (buff.type == Buff.buffType.NEGATIVE
|
||||||
|
|
Loading…
Reference in New Issue
Block a user