Merging 1.9.1 source: moved some quest class references
This commit is contained in:
parent
763509d3e5
commit
83b60bf5a4
|
@ -87,6 +87,22 @@ public class ShatteredPixelDungeon extends Game {
|
|||
com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfTeleportation" );
|
||||
|
||||
//0.3.3
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FetidRat.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost$FetidRat" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost$GnollTrickster" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GreatCrab.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost$GreatCrab" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker$Rotberry" );
|
||||
com.watabou.utils.Bundle.addAlias(
|
||||
com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry.Seed.class,
|
||||
"com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker$Rotberry$Seed" );
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class Bestiary {
|
||||
|
@ -184,6 +183,6 @@ public class Bestiary {
|
|||
public static boolean isUnique( Char mob ) {
|
||||
return mob instanceof Goo || mob instanceof Tengu || mob instanceof DM300 || mob instanceof King
|
||||
|| mob instanceof Yog.BurningFist || mob instanceof Yog.RottingFist
|
||||
|| mob instanceof Ghost.FetidRat || mob instanceof Ghost.GnollTrickster || mob instanceof Ghost.GreatCrab;
|
||||
|| mob instanceof FetidRat || mob instanceof GnollTrickster || mob instanceof GreatCrab;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2015 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.FetidRatSprite;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class FetidRat extends Rat {
|
||||
|
||||
{
|
||||
name = "fetid rat";
|
||||
spriteClass = FetidRatSprite.class;
|
||||
|
||||
HP = HT = 20;
|
||||
defenseSkill = 5;
|
||||
|
||||
EXP = 4;
|
||||
|
||||
state = WANDERING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int dr() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackProc( Char enemy, int damage ) {
|
||||
if (Random.Int(3) == 0) {
|
||||
Buff.affect(enemy, Ooze.class);
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int defenseProc( Char enemy, int damage ) {
|
||||
|
||||
GameScene.add(Blob.seed(pos, 20, StenchGas.class));
|
||||
|
||||
return super.defenseProc(enemy, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Ghost.Quest.process();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"Something is clearly wrong with this rat. Its greasy black fur and rotting skin are very " +
|
||||
"different from the healthy rats you've seen previously. It's pale green eyes " +
|
||||
"make it seem especially menacing.\n\n" +
|
||||
"The rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\n" +
|
||||
"Dark ooze dribbles from the rat's mouth, it eats through the floor but seems to dissolve in water.";
|
||||
}
|
||||
|
||||
private static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
|
||||
static {
|
||||
IMMUNITIES.add( StenchGas.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<Class<?>> immunities() {
|
||||
return IMMUNITIES;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2015 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class GnollTrickster extends Gnoll {
|
||||
{
|
||||
name = "gnoll trickster";
|
||||
spriteClass = GnollTricksterSprite.class;
|
||||
|
||||
HP = HT = 20;
|
||||
defenseSkill = 5;
|
||||
|
||||
EXP = 5;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
loot = Generator.random(CurareDart.class);
|
||||
lootChance = 1f;
|
||||
}
|
||||
|
||||
private int combo = 0;
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canAttack( Char enemy ) {
|
||||
Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE);
|
||||
return !Level.adjacent(pos, enemy.pos) && attack.collisionPos == enemy.pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackProc( Char enemy, int damage ) {
|
||||
//The gnoll's attacks get more severe the more the player lets it hit them
|
||||
combo++;
|
||||
int effect = Random.Int(4)+combo;
|
||||
|
||||
if (effect > 2) {
|
||||
|
||||
if (effect >=6 && enemy.buff(Burning.class) == null){
|
||||
|
||||
if (Level.flamable[enemy.pos])
|
||||
GameScene.add(Blob.seed(enemy.pos, 4, Fire.class));
|
||||
Buff.affect(enemy, Burning.class).reignite( enemy );
|
||||
|
||||
} else
|
||||
Buff.affect( enemy, Poison.class).set((effect-2) * Poison.durationFactor(enemy));
|
||||
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getCloser( int target ) {
|
||||
combo = 0; //if he's moving, he isn't attacking, reset combo.
|
||||
if (state == HUNTING) {
|
||||
return enemySeen && getFurther( target );
|
||||
} else {
|
||||
return super.getCloser( target );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Ghost.Quest.process();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"A strange looking creature, even by gnoll standards. It hunches forward with a wicked grin, " +
|
||||
"almost cradling the satchel hanging over its shoulder. Its eyes are wide with a strange mix of " +
|
||||
"fear and excitement.\n\n" +
|
||||
"There is a large collection of poorly made darts in its satchel, they all seem to be " +
|
||||
"tipped with various harmful substances.";
|
||||
}
|
||||
|
||||
private static final String COMBO = "combo";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(COMBO, combo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
combo = bundle.getInt( COMBO );
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2015 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GreatCrabSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class GreatCrab extends Crab {
|
||||
{
|
||||
name = "great crab";
|
||||
spriteClass = GreatCrabSprite.class;
|
||||
|
||||
HP = HT = 25;
|
||||
defenseSkill = 0; //see damage()
|
||||
baseSpeed = 1f;
|
||||
|
||||
EXP = 6;
|
||||
|
||||
state = WANDERING;
|
||||
}
|
||||
|
||||
private int moving = 0;
|
||||
|
||||
@Override
|
||||
protected boolean getCloser( int target ) {
|
||||
//this is used so that the crab remains slower, but still detects the player at the expected rate.
|
||||
moving++;
|
||||
if (moving < 3) {
|
||||
return super.getCloser( target );
|
||||
} else {
|
||||
moving = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damage( int dmg, Object src ){
|
||||
//crab blocks all attacks originating from the hero or enemy characters or traps if it is alerted.
|
||||
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
||||
if (enemySeen && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)){
|
||||
GLog.n("The crab notices the attack and blocks with its massive claw.");
|
||||
sprite.showStatus( CharSprite.NEUTRAL, "blocked" );
|
||||
} else {
|
||||
super.damage( dmg, src );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Ghost.Quest.process();
|
||||
|
||||
Dungeon.level.drop( new MysteryMeat(), pos );
|
||||
Dungeon.level.drop( new MysteryMeat(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"This crab is gigantic, even compared to other sewer crabs. " +
|
||||
"Its blue shell is covered in cracks and barnacles, showing great age. " +
|
||||
"It lumbers around slowly, barely keeping balance with its massive claw.\n\n" +
|
||||
"While the crab only has one claw, its size easily compensates. " +
|
||||
"The crab holds the claw infront of itself whenever it sees a threat, shielding " +
|
||||
"itself behind an impenetrable wall of carapace.";
|
||||
}
|
||||
}
|
|
@ -24,8 +24,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite;
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class RotHeart extends Mob {
|
|||
@Override
|
||||
public void die(Object cause) {
|
||||
super.die(cause);
|
||||
Dungeon.level.drop( new Wandmaker.Rotberry.Seed(), pos ).sprite.drop();
|
||||
Dungeon.level.drop( new Rotberry.Seed(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,41 +23,24 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Journal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Crab;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Gnoll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Rat;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FetidRat;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GreatCrab;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.FetidRatSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GreatCrabSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
|
||||
|
@ -376,235 +359,4 @@ public class Ghost extends NPC {
|
|||
return spawned && processed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class FetidRat extends Rat {
|
||||
|
||||
{
|
||||
name = "fetid rat";
|
||||
spriteClass = FetidRatSprite.class;
|
||||
|
||||
HP = HT = 20;
|
||||
defenseSkill = 5;
|
||||
|
||||
EXP = 4;
|
||||
|
||||
state = WANDERING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int dr() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackProc( Char enemy, int damage ) {
|
||||
if (Random.Int( 3 ) == 0) {
|
||||
Buff.affect(enemy, Ooze.class);
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int defenseProc( Char enemy, int damage ) {
|
||||
|
||||
GameScene.add( Blob.seed( pos, 20, StenchGas.class ) );
|
||||
|
||||
return super.defenseProc(enemy, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Quest.process();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"Something is clearly wrong with this rat. Its greasy black fur and rotting skin are very " +
|
||||
"different from the healthy rats you've seen previously. It's pale green eyes " +
|
||||
"make it seem especially menacing.\n\n" +
|
||||
"The rat carries a cloud of horrible stench with it, it's overpoweringly strong up close.\n\n" +
|
||||
"Dark ooze dribbles from the rat's mouth, it eats through the floor but seems to dissolve in water.";
|
||||
}
|
||||
|
||||
private static final HashSet<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
|
||||
static {
|
||||
IMMUNITIES.add( StenchGas.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<Class<?>> immunities() {
|
||||
return IMMUNITIES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class GnollTrickster extends Gnoll {
|
||||
{
|
||||
name = "gnoll trickster";
|
||||
spriteClass = GnollTricksterSprite.class;
|
||||
|
||||
HP = HT = 20;
|
||||
defenseSkill = 5;
|
||||
|
||||
EXP = 5;
|
||||
|
||||
state = WANDERING;
|
||||
|
||||
loot = Generator.random(CurareDart.class);
|
||||
lootChance = 1f;
|
||||
}
|
||||
|
||||
private int combo = 0;
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canAttack( Char enemy ) {
|
||||
Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE);
|
||||
return !Level.adjacent( pos, enemy.pos ) && attack.collisionPos == enemy.pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackProc( Char enemy, int damage ) {
|
||||
//The gnoll's attacks get more severe the more the player lets it hit them
|
||||
combo++;
|
||||
int effect = Random.Int(4)+combo;
|
||||
|
||||
if (effect > 2) {
|
||||
|
||||
if (effect >=6 && enemy.buff(Burning.class) == null){
|
||||
|
||||
if (Level.flamable[enemy.pos])
|
||||
GameScene.add( Blob.seed( enemy.pos, 4, Fire.class ) );
|
||||
Buff.affect( enemy, Burning.class ).reignite( enemy );
|
||||
|
||||
} else
|
||||
Buff.affect( enemy, Poison.class).set((effect-2) * Poison.durationFactor(enemy));
|
||||
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getCloser( int target ) {
|
||||
combo = 0; //if he's moving, he isn't attacking, reset combo.
|
||||
if (state == HUNTING) {
|
||||
return enemySeen && getFurther( target );
|
||||
} else {
|
||||
return super.getCloser( target );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Quest.process();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"A strange looking creature, even by gnoll standards. It hunches forward with a wicked grin, " +
|
||||
"almost cradling the satchel hanging over its shoulder. Its eyes are wide with a strange mix of " +
|
||||
"fear and excitement.\n\n" +
|
||||
"There is a large collection of poorly made darts in its satchel, they all seem to be " +
|
||||
"tipped with various harmful substances.";
|
||||
}
|
||||
|
||||
private static final String COMBO = "combo";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(COMBO, combo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
combo = bundle.getInt( COMBO );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class GreatCrab extends Crab {
|
||||
{
|
||||
name = "great crab";
|
||||
spriteClass = GreatCrabSprite.class;
|
||||
|
||||
HP = HT = 25;
|
||||
defenseSkill = 0; //see damage()
|
||||
baseSpeed = 1f;
|
||||
|
||||
EXP = 6;
|
||||
|
||||
state = WANDERING;
|
||||
}
|
||||
|
||||
private int moving = 0;
|
||||
|
||||
@Override
|
||||
protected boolean getCloser( int target ) {
|
||||
//this is used so that the crab remains slower, but still detects the player at the expected rate.
|
||||
moving++;
|
||||
if (moving < 3) {
|
||||
return super.getCloser( target );
|
||||
} else {
|
||||
moving = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damage( int dmg, Object src ){
|
||||
//crab blocks all attacks originating from the hero or enemy characters or traps if it is alerted.
|
||||
//All direct damage from these sources is negated, no exceptions. blob/debuff effects go through as normal.
|
||||
if (enemySeen && (src instanceof Wand || src instanceof LightningTrap.Electricity || src instanceof Char)){
|
||||
GLog.n("The crab notices the attack and blocks with its massive claw.");
|
||||
sprite.showStatus( CharSprite.NEUTRAL, "blocked" );
|
||||
} else {
|
||||
super.damage( dmg, src );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
super.die( cause );
|
||||
|
||||
Quest.process();
|
||||
|
||||
Dungeon.level.drop( new MysteryMeat(), pos );
|
||||
Dungeon.level.drop( new MysteryMeat(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return
|
||||
"This crab is gigantic, even compared to other sewer crabs. " +
|
||||
"Its blue shell is covered in cracks and barnacles, showing great age. " +
|
||||
"It lumbers around slowly, barely keeping balance with its massive claw.\n\n" +
|
||||
"While the crab only has one claw, its size easily compensates. " +
|
||||
"The crab holds the claw infront of itself whenever it sees a threat, shielding " +
|
||||
"itself behind an impenetrable wall of carapace.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,40 +20,25 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CeremonialCandle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Journal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.WandmakerSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndWandmaker;
|
||||
|
@ -397,53 +382,4 @@ public class Wandmaker extends NPC {
|
|||
Journal.remove( Journal.Feature.WANDMAKER );
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: externalize this into its own class in 0.3.3 (when merging source)
|
||||
public static class Rotberry extends Plant {
|
||||
|
||||
private static final String TXT_DESC =
|
||||
"The berries of a young rotberry shrub taste like sweet, sweet death.\n" +
|
||||
"\n" +
|
||||
"Regularly picking the berries of a rotberry shrub is essential, otherwise it will mature";
|
||||
|
||||
{
|
||||
image = 7;
|
||||
plantName = "Rotberry";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
Char ch = Actor.findChar(pos);
|
||||
|
||||
GameScene.add( Blob.seed( pos, 100, ToxicGas.class ) );
|
||||
|
||||
Dungeon.level.drop( new Seed(), pos ).sprite.drop();
|
||||
|
||||
if (ch != null) {
|
||||
Buff.prolong( ch, Roots.class, TICK * 3 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
|
||||
public static class Seed extends Plant.Seed {
|
||||
{
|
||||
plantName = "Rotberry";
|
||||
|
||||
name = "seed of " + plantName;
|
||||
image = ItemSpriteSheet.SEED_ROTBERRY;
|
||||
|
||||
plantClass = Rotberry.class;
|
||||
alchemyClass = PotionOfStrength.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker.Rotberry;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
|
|
|
@ -35,22 +35,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Blindweed;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Dreamfoil;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Fadeleaf;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Firebloom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Icecap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant.Seed;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Sorrowmoss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Stormvine;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
@ -322,7 +313,7 @@ public class Blandfruit extends Food {
|
|||
if (name.equals("Healthfruit"))
|
||||
cook(new Sungrass.Seed());
|
||||
else if (name.equals("Powerfruit"))
|
||||
cook(new Wandmaker.Rotberry.Seed());
|
||||
cook(new Rotberry.Seed());
|
||||
else if (name.equals("Paralyzefruit"))
|
||||
cook(new Earthroot.Seed());
|
||||
else if (name.equals("Invisifruit"))
|
||||
|
|
|
@ -26,12 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DM300;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Goo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Tengu;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Yog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
|
@ -55,7 +50,7 @@ public class WandOfCorruption extends Wand {
|
|||
|
||||
//FIXME: sloppy
|
||||
private static HashSet<Class> bosses = new HashSet<Class>(Arrays.asList(
|
||||
Ghost.FetidRat.class, Ghost.GnollTrickster.class, Ghost.GreatCrab.class,
|
||||
FetidRat.class, GnollTrickster.class, GreatCrab.class,
|
||||
Goo.class, Tengu.class, DM300.class, King.class,
|
||||
Yog.class, Yog.BurningFist.class, Yog.RottingFist.class
|
||||
));
|
||||
|
|
|
@ -30,14 +30,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.RainbowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Paralysis;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
|
@ -66,7 +64,7 @@ public class WandOfPrismaticLight extends Wand {
|
|||
//Any Location
|
||||
Mimic.class, Wraith.class,
|
||||
//Sewers
|
||||
Ghost.FetidRat.class,
|
||||
FetidRat.class,
|
||||
Goo.class,
|
||||
//Prison
|
||||
Skeleton.class , Thief.class, Bandit.class,
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.*;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
@ -75,7 +74,7 @@ public class WandOfTransfusion extends Wand {
|
|||
//Any Location
|
||||
Wraith.class,
|
||||
//Sewers
|
||||
Ghost.FetidRat.class,
|
||||
FetidRat.class,
|
||||
//Prison
|
||||
Skeleton.class,
|
||||
//City
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2015 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.plants;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class Rotberry extends Plant {
|
||||
|
||||
private static final String TXT_DESC =
|
||||
"The berries of a young rotberry shrub taste like sweet, sweet death.\n" +
|
||||
"\n" +
|
||||
"Regularly picking the berries of a rotberry shrub is essential, otherwise it will mature";
|
||||
|
||||
{
|
||||
image = 7;
|
||||
plantName = "Rotberry";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
Dungeon.level.drop( new Seed(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
|
||||
public static class Seed extends Plant.Seed {
|
||||
{
|
||||
plantName = "Rotberry";
|
||||
|
||||
name = "seed of " + plantName;
|
||||
image = ItemSpriteSheet.SEED_ROTBERRY;
|
||||
|
||||
plantClass = Rotberry.class;
|
||||
alchemyClass = PotionOfStrength.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return TXT_DESC;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry;
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
|
@ -70,7 +71,7 @@ public class WndWandmaker extends Window {
|
|||
msg = TXT_DUST;
|
||||
} else if (item instanceof Embers){
|
||||
msg = TXT_EMBER;
|
||||
} else if (item instanceof Wandmaker.Rotberry.Seed){
|
||||
} else if (item instanceof Rotberry.Seed){
|
||||
msg = TXT_BERRY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user