v0.7.0: implement scroll of prismatic image and scroll of polymorph
This commit is contained in:
parent
7aeccd2826
commit
f88f7cd6bc
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.buffs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class PrismaticGuard extends Buff {
|
||||
|
||||
{
|
||||
type = buffType.POSITIVE;
|
||||
}
|
||||
|
||||
private float HP;
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
|
||||
Hero hero = (Hero)target;
|
||||
|
||||
Mob closest = null;
|
||||
int v = hero.visibleEnemies();
|
||||
for (int i=0; i < v; i++) {
|
||||
Mob mob = hero.visibleEnemy( i );
|
||||
if ( mob.isAlive() && !hero.mindVisionEnemies.contains(mob)
|
||||
&& (closest == null || Dungeon.level.distance(hero.pos, mob.pos) < Dungeon.level.distance(hero.pos, closest.pos))) {
|
||||
closest = mob;
|
||||
}
|
||||
}
|
||||
|
||||
if (closest != null && Dungeon.level.distance(hero.pos, closest.pos) < 5){
|
||||
//spawn guardian
|
||||
int bestPos = -1;
|
||||
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
|
||||
int p = hero.pos + PathFinder.NEIGHBOURS8[i];
|
||||
if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) {
|
||||
if (bestPos == -1 || Dungeon.level.trueDistance(p, closest.pos) < Dungeon.level.trueDistance(bestPos, closest.pos)){
|
||||
bestPos = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bestPos != -1) {
|
||||
PrismaticImage pris = new PrismaticImage();
|
||||
pris.duplicate(hero, (int)Math.floor(HP) );
|
||||
pris.state = pris.HUNTING;
|
||||
GameScene.add(pris);
|
||||
ScrollOfTeleportation.appear(pris, bestPos);
|
||||
|
||||
detach();
|
||||
} else {
|
||||
spend( TICK );
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
spend(TICK);
|
||||
}
|
||||
|
||||
if (HP < maxHP()){
|
||||
HP += 0.1f;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void set( int HP ){
|
||||
this.HP = HP;
|
||||
}
|
||||
|
||||
public int maxHP(){
|
||||
return maxHP((Hero)target);
|
||||
}
|
||||
|
||||
public static int maxHP( Hero hero ){
|
||||
return 8 + (int)Math.floor(hero.lvl * 2.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.ARMOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tintIcon(Image icon) {
|
||||
icon.tint(0.5f, 0.5f, 1, 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Messages.get(this, "name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return Messages.get(this, "desc", (int)HP, maxHP());
|
||||
}
|
||||
|
||||
private static final String HEALTH = "hp";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(HEALTH, HP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
HP = bundle.getFloat(HEALTH);
|
||||
}
|
||||
}
|
|
@ -92,6 +92,7 @@ public class MirrorImage extends NPC {
|
|||
|
||||
public void duplicate( Hero hero ) {
|
||||
this.hero = hero;
|
||||
heroID = this.hero.id();
|
||||
Buff.affect(this, MirrorInvis.class, Short.MAX_VALUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,250 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.npcs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PrismaticGuard;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class PrismaticImage extends NPC {
|
||||
|
||||
{
|
||||
spriteClass = PrismaticSprite.class;
|
||||
|
||||
HP = HT = 8;
|
||||
defenseSkill = 0;
|
||||
|
||||
alignment = Alignment.ALLY;
|
||||
state = HUNTING;
|
||||
|
||||
WANDERING = new Wandering();
|
||||
|
||||
//before other mobs
|
||||
actPriority = MOB_PRIO + 1;
|
||||
}
|
||||
|
||||
private Hero hero;
|
||||
private int heroID;
|
||||
public int armTier;
|
||||
|
||||
private int deathTimer = -1;
|
||||
|
||||
@Override
|
||||
protected boolean act() {
|
||||
|
||||
if (!isAlive()){
|
||||
deathTimer--;
|
||||
|
||||
if (deathTimer > 0) {
|
||||
sprite.alpha((deathTimer + 3) / 8f);
|
||||
spend(TICK);
|
||||
} else {
|
||||
destroy();
|
||||
sprite.die();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (deathTimer != -1){
|
||||
if (paralysed == 0) sprite.remove(CharSprite.State.PARALYSED);
|
||||
deathTimer = -1;
|
||||
sprite.resetColor();
|
||||
}
|
||||
|
||||
if ( hero == null ){
|
||||
hero = (Hero) Actor.findById(heroID);
|
||||
if ( hero == null ){
|
||||
destroy();
|
||||
sprite.die();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hero.tier() != armTier){
|
||||
armTier = hero.tier();
|
||||
((PrismaticSprite)sprite).updateArmor( armTier );
|
||||
}
|
||||
|
||||
return super.act();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die(Object cause) {
|
||||
if (deathTimer == -1) {
|
||||
deathTimer = 5;
|
||||
sprite.add(CharSprite.State.PARALYSED);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String HEROID = "hero_id";
|
||||
private static final String TIMER = "timer";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( HEROID, heroID );
|
||||
bundle.put( TIMER, deathTimer );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
heroID = bundle.getInt( HEROID );
|
||||
deathTimer = bundle.getInt( TIMER );
|
||||
}
|
||||
|
||||
public void duplicate( Hero hero, int HP ) {
|
||||
this.hero = hero;
|
||||
heroID = this.hero.id();
|
||||
this.HP = HP;
|
||||
HT = PrismaticGuard.maxHP( hero );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageRoll() {
|
||||
return Random.NormalIntRange( 1 + hero.lvl/8, 4 + hero.lvl/2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return hero.attackSkill(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int defenseSkill(Char enemy) {
|
||||
if (hero != null) {
|
||||
int baseEvasion = 4 + hero.lvl;
|
||||
int heroEvasion = hero.defenseSkill(enemy);
|
||||
|
||||
//if the hero has more/less evasion, 50% of it is applied
|
||||
return (baseEvasion + heroEvasion) / 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int drRoll() {
|
||||
if (hero != null){
|
||||
return hero.drRoll();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int defenseProc(Char enemy, int damage) {
|
||||
damage = super.defenseProc(enemy, damage);
|
||||
if (hero.belongings.armor != null){
|
||||
return hero.belongings.armor.proc( enemy, this, damage );
|
||||
} else {
|
||||
return damage;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float speed() {
|
||||
if (hero.belongings.armor != null){
|
||||
return hero.belongings.armor.speedFactor(this, super.speed());
|
||||
}
|
||||
return super.speed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackProc( Char enemy, int damage ) {
|
||||
|
||||
if (enemy instanceof Mob) {
|
||||
((Mob)enemy).aggro( this );
|
||||
}
|
||||
|
||||
return super.attackProc( enemy, damage );
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSprite sprite() {
|
||||
CharSprite s = super.sprite();
|
||||
|
||||
hero = (Hero)Actor.findById(heroID);
|
||||
if (hero != null) {
|
||||
armTier = hero.tier();
|
||||
}
|
||||
((PrismaticSprite)s).updateArmor( armTier );
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interact() {
|
||||
|
||||
int curPos = pos;
|
||||
|
||||
moveSprite( pos, Dungeon.hero.pos );
|
||||
move( Dungeon.hero.pos );
|
||||
|
||||
Dungeon.hero.sprite.move( Dungeon.hero.pos, curPos );
|
||||
Dungeon.hero.move( curPos );
|
||||
|
||||
Dungeon.hero.spend( 1 / Dungeon.hero.speed() );
|
||||
Dungeon.hero.busy();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add( ToxicGas.class );
|
||||
immunities.add( CorrosiveGas.class );
|
||||
immunities.add( Burning.class );
|
||||
}
|
||||
|
||||
private class Wandering extends Mob.Wandering{
|
||||
|
||||
@Override
|
||||
public boolean act(boolean enemyInFOV, boolean justAlerted) {
|
||||
if (!enemyInFOV){
|
||||
Buff.affect(hero, PrismaticGuard.class).set( HP );
|
||||
destroy();
|
||||
CellEmitter.get(pos).start( Speck.factory(Speck.LIGHT), 0.2f, 3 );
|
||||
sprite.die();
|
||||
Sample.INSTANCE.play( Assets.SND_TELEPORT );
|
||||
return true;
|
||||
} else {
|
||||
return super.act(enemyInFOV, justAlerted);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -358,7 +358,7 @@ public class Armor extends EquipableItem {
|
|||
damage = glyph.proc( this, attacker, defender, damage );
|
||||
}
|
||||
|
||||
if (!levelKnown) {
|
||||
if (!levelKnown && defender instanceof Hero) {
|
||||
if (--hitsToKnow <= 0) {
|
||||
identify();
|
||||
GLog.w( Messages.get(Armor.class, "identify") );
|
||||
|
|
|
@ -81,13 +81,11 @@ public abstract class ExoticScroll extends Scroll {
|
|||
regToExo.put(ScrollOfRetribution.class, ScrollOfPsionicBlast.class);
|
||||
exoToReg.put(ScrollOfPsionicBlast.class, ScrollOfRetribution.class);
|
||||
|
||||
//TODO
|
||||
regToExo.put(ScrollOfMirrorImage.class, ScrollOfPrismaticImage.class);
|
||||
exoToReg.put(ScrollOfPrismaticImage.class, ScrollOfMirrorImage.class);
|
||||
|
||||
regToExo.put(ScrollOfMirrorImage.class, ScrollOfDivination.class);
|
||||
//exoToReg.put(ScrollOfDivination.class, ScrollOfMirrorImage.class);
|
||||
|
||||
regToExo.put(ScrollOfTransmutation.class, ScrollOfDivination.class);
|
||||
//exoToReg.put(ScrollOfDivination.class, ScrollOfTransmutation.class);
|
||||
regToExo.put(ScrollOfTransmutation.class, ScrollOfPolymorph.class);
|
||||
exoToReg.put(ScrollOfPolymorph.class, ScrollOfTransmutation.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.items.scrolls.exotic;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.watabou.noosa.Game;
|
||||
|
||||
public class ScrollOfDistortion extends ExoticScroll {
|
||||
|
||||
{
|
||||
initials = 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRead() {
|
||||
//FIXME this doesn't handle various edge-cases. especially as it can trigger in boss rooms!
|
||||
InterlevelScene.returnDepth = Dungeon.depth;
|
||||
Belongings belongings = Dungeon.hero.belongings;
|
||||
|
||||
for (Notes.Record rec : Notes.getRecords()){
|
||||
if (rec.depth() == Dungeon.depth){
|
||||
Notes.remove(rec);
|
||||
}
|
||||
}
|
||||
|
||||
for (Item i : belongings){
|
||||
if (i instanceof LloydsBeacon && ((LloydsBeacon) i).returnDepth == Dungeon.depth)
|
||||
((LloydsBeacon) i).returnDepth = -1;
|
||||
}
|
||||
|
||||
InterlevelScene.mode = InterlevelScene.Mode.RESET;
|
||||
Game.switchScene(InterlevelScene.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.items.scrolls.exotic;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
public class ScrollOfPolymorph extends ExoticScroll {
|
||||
|
||||
{
|
||||
initials = 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRead() {
|
||||
|
||||
new Flare( 5, 32 ).color( 0xFFFFFF, true ).show( curUser.sprite, 2f );
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
|
||||
if (Dungeon.level.heroFOV[mob.pos]) {
|
||||
if (!mob.properties().contains(Char.Property.BOSS)
|
||||
&& !mob.properties().contains(Char.Property.MINIBOSS)){
|
||||
Sheep sheep = new Sheep();
|
||||
sheep.lifespan = 10;
|
||||
sheep.pos = mob.pos;
|
||||
mob.destroy();
|
||||
mob.sprite.killAndErase();
|
||||
Dungeon.level.mobs.remove(mob);
|
||||
TargetHealthIndicator.instance.target(null);
|
||||
GameScene.add(sheep);
|
||||
CellEmitter.get(sheep.pos).burst(Speck.factory(Speck.WOOL), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
setKnown();
|
||||
|
||||
readAnimation();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.items.scrolls.exotic;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PrismaticGuard;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
public class ScrollOfPrismaticImage extends ExoticScroll {
|
||||
|
||||
{
|
||||
initials = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRead() {
|
||||
|
||||
boolean found = false;
|
||||
for (Mob m : Dungeon.level.mobs.toArray(new Mob[0])){
|
||||
if (m instanceof PrismaticImage){
|
||||
found = true;
|
||||
m.HP = m.HT;
|
||||
m.sprite.emitter().burst(Speck.factory(Speck.HEALING), 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
Buff.affect(curUser, PrismaticGuard.class).set( PrismaticGuard.maxHP( curUser ) );
|
||||
}
|
||||
|
||||
setKnown();
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
readAnimation();
|
||||
}
|
||||
}
|
|
@ -111,7 +111,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
|||
private Tweener jumpTweener;
|
||||
private Callback jumpCallback;
|
||||
|
||||
private float flashTime = 0;
|
||||
protected float flashTime = 0;
|
||||
|
||||
protected boolean sleeping = false;
|
||||
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 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.sprites;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
|
||||
public class PrismaticSprite extends MobSprite {
|
||||
|
||||
private static final int FRAME_WIDTH = 12;
|
||||
private static final int FRAME_HEIGHT = 15;
|
||||
|
||||
public PrismaticSprite() {
|
||||
super();
|
||||
|
||||
texture( Dungeon.hero.heroClass.spritesheet() );
|
||||
updateArmor( 0 );
|
||||
idle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void link( Char ch ) {
|
||||
super.link( ch );
|
||||
updateArmor( ((PrismaticImage)ch).armTier );
|
||||
}
|
||||
|
||||
public void updateArmor( int tier ) {
|
||||
TextureFilm film = new TextureFilm( HeroSprite.tiers(), tier, FRAME_WIDTH, FRAME_HEIGHT );
|
||||
|
||||
idle = new Animation( 1, true );
|
||||
idle.frames( film, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 20, true );
|
||||
run.frames( film, 2, 3, 4, 5, 6, 7 );
|
||||
|
||||
die = new Animation( 20, false );
|
||||
die.frames( film, 0 );
|
||||
|
||||
attack = new Animation( 15, false );
|
||||
attack.frames( film, 13, 14, 15, 0 );
|
||||
|
||||
idle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (flashTime <= 0){
|
||||
float interval = (Game.timeTotal % 9 ) /3f;
|
||||
tint(interval > 2 ? interval - 2 : Math.max(0, 1 - interval),
|
||||
interval > 1 ? Math.max(0, 2-interval): interval,
|
||||
interval > 2 ? Math.max(0, 3-interval): interval-1, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -220,6 +220,9 @@ actors.buffs.preparation.prompt=Select a target to attack!\nMax blink distance:
|
|||
actors.buffs.preparation.no_target=There's nothing to attack there.
|
||||
actors.buffs.preparation.out_of_reach=That target is out of reach.
|
||||
|
||||
actors.buffs.prismaticguard.name=Prismatic Guard
|
||||
actors.buffs.prismaticguard.desc=You are being guarded by a prismatic image which is currently inactive. When enemies are present the prismatic image will spring to action and protect you!\n\nWhile inactive, the prismatic image will steadily recover from any damage it has taken.\n\nCurrent HP: %d/%d.
|
||||
|
||||
actors.buffs.recharging.name=Recharging
|
||||
actors.buffs.recharging.desc=Energy is coursing through you, improving the rate that your wands and staffs charge.\n\nEach turn this buff will increase current charge by one quarter, in addition to regular recharge.\n\nTurns of recharging remaining: %s.
|
||||
|
||||
|
@ -368,6 +371,9 @@ actors.mobs.npcs.impshopkeeper.desc=Imps are lesser demons. They are notable for
|
|||
actors.mobs.npcs.mirrorimage.name=mirror image
|
||||
actors.mobs.npcs.mirrorimage.desc=This illusion bears a close resemblance to you, even seeming to wield your current weapon and armor.\n\nMirror images will seek and attack enemies using their mimicked weapon, which behaves the same as yours, but deals less damage. They start out ethereal, but must take on a solid form in order to attack.\n\nWhile their offensive power can be potent, mirror images have no durability, and will fade the moment they take damage.
|
||||
|
||||
actors.mobs.npcs.prismaticimage.name=prismatic image
|
||||
actors.mobs.npcs.prismaticimage.desc=This shimmering illusion bears a close resemblance to you, even seeming to wield your current weapon and armor.\n\nPrismatic images will attempt to seek and draw focus from enemies, using their enhanced defense and health to protect you. While they do not have the same offensive power as mirror images, they have enhanced durability, including receiving benefits from your armor.\n\nWhen reduced to 0 hp, prismatic images will fade over several turns, and can still be healed during this time. When no enemies are present, prismatic images will fade and rejoin their master.
|
||||
|
||||
actors.mobs.npcs.ratking.name=rat king
|
||||
actors.mobs.npcs.ratking.not_sleeping=I'm not sleeping!
|
||||
actors.mobs.npcs.ratking.what_is_it=What is it? I have no time for this nonsense. My kingdom won't rule itself!
|
||||
|
|
|
@ -578,7 +578,7 @@ items.potions.exotic.potionofholyfuror.name=potion of holy furor
|
|||
items.potions.exotic.potionofholyfuror.desc=The power of holy energy reduced to liquid form, this draught will bless you for an extended period of time.
|
||||
|
||||
items.potions.exotic.potionofmagicalsight.name=potion of magical sight
|
||||
items.potions.exotic.potionofmagicalsight.desc=After drinking this, your senses will be breifly heightened to incredible levels, allowing you to see through walls!
|
||||
items.potions.exotic.potionofmagicalsight.desc=After drinking this, your senses will be briefly heightened to incredible levels, allowing you to see through walls!
|
||||
|
||||
items.potions.exotic.potionofshielding.name=potion of shielding
|
||||
items.potions.exotic.potionofshielding.desc=Rather than heal, this potion will instead project a durable shield around the user's body, blocking a considerable amount of damage.
|
||||
|
@ -821,6 +821,12 @@ items.scrolls.exotic.scrollofpassage.desc=The spell on this parchment instantly
|
|||
items.scrolls.exotic.scrollofpetrification.name=scroll of petrification
|
||||
items.scrolls.exotic.scrollofpetrification.desc=A flash of red light will overwhelm all creatures in your field of view with such great terror that they will be frozen on the spot.
|
||||
|
||||
items.scrolls.exotic.scrollofpolymorph.name=scroll of polymorph
|
||||
items.scrolls.exotic.scrollofpolymorph.desc=This scroll contains powerful transmutation magic. When invoked, all enemies in the reader's sight will be transformed into magical sheep!\n\nThe transformation is permanent, eliminating all enemies affected. Powerful enemies will resist the effect though, and any items affected enemies were carrying are lost.
|
||||
|
||||
items.scrolls.exotic.scrollofprismaticimage.name=scroll of prismatic image
|
||||
items.scrolls.exotic.scrollofprismaticimage.desc=The incantation on this scroll will create a colorful illusory twin of the reader. This prismatic image acts as a weaker clone of the reader, with similar defence but lower hp and damage.\n\nThe prismatic image will show itself when enemies are present, and will attempt to defend the reader.\n\nIf a prismatic image already exists, using this scroll will fully heal it.
|
||||
|
||||
items.scrolls.exotic.scrollofpsionicblast.name=scroll of psionic blast
|
||||
items.scrolls.exotic.scrollofpsionicblast.ondeath=The Psionic Blast tears your mind apart...
|
||||
items.scrolls.exotic.scrollofpsionicblast.desc=This scroll contains incredible destructive energy that can be channeled to destroy the minds of all visible creatures.\n\nThere is significant feedback however, and the reader will also be damaged, blinded, and weakened. The more targets the scroll hits, the less self-damage will be taken.
|
||||
|
|
Loading…
Reference in New Issue
Block a user