Merge remote-tracking branch 'origin/master'
BIN
assets/buffs.png
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.6 KiB |
|
@ -235,6 +235,9 @@ public abstract class Char extends Actor {
|
||||||
Buff.prolong(this, Paralysis.class, 1f);
|
Buff.prolong(this, Paralysis.class, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.buff(MagicalSleep.class) != null){
|
||||||
|
Buff.detach(this, MagicalSleep.class);
|
||||||
|
}
|
||||||
|
|
||||||
Class<?> srcClass = src.getClass();
|
Class<?> srcClass = src.getClass();
|
||||||
if (immunities().contains( srcClass )) {
|
if (immunities().contains( srcClass )) {
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2014 Oleg Dolya
|
||||||
|
*
|
||||||
|
* 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.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
|
||||||
|
public class Drowsy extends FlavourBuff {
|
||||||
|
|
||||||
|
public static final float DURATION = 4f;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int icon() {
|
||||||
|
return BuffIndicator.DROWSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean act(){
|
||||||
|
Buff.affect(target, MagicalSleep.class);
|
||||||
|
GLog.i("You fall into a deep magical sleep.");
|
||||||
|
return super.act();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Drowsy";
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,13 +20,11 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Elemental;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.utils.Random;
|
|
||||||
|
|
||||||
public class Frost extends FlavourBuff {
|
public class Frost extends FlavourBuff {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2014 Oleg Dolya
|
||||||
|
*
|
||||||
|
* 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.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
|
||||||
|
public class MagicalSleep extends Buff {
|
||||||
|
|
||||||
|
private static final float STEP = 1f;
|
||||||
|
public static final float SWS = 1.5f;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean attachTo( Char target ) {
|
||||||
|
if (super.attachTo( target )) {
|
||||||
|
|
||||||
|
target.paralysed = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean act(){
|
||||||
|
if (target instanceof Hero) {
|
||||||
|
target.HP = Math.min(target.HP+1, target.HT);
|
||||||
|
if (target.HP == target.HT) {
|
||||||
|
GLog.p("You wake up feeling refreshed and healthy.");
|
||||||
|
detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spend( STEP );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detach() {
|
||||||
|
target.paralysed = false;
|
||||||
|
super.detach();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int icon() {
|
||||||
|
return BuffIndicator.MAGIC_SLEEP;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Magical Sleep";
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
@ -821,6 +822,10 @@ public class Hero extends Char {
|
||||||
@Override
|
@Override
|
||||||
public void damage( int dmg, Object src ) {
|
public void damage( int dmg, Object src ) {
|
||||||
restoreHealth = false;
|
restoreHealth = false;
|
||||||
|
if (this.buff(Drowsy.class) != null){
|
||||||
|
Buff.detach(this, Drowsy.class);
|
||||||
|
GLog.i("The pain helps you resist the urge to sleep.");
|
||||||
|
}
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
|
|
||||||
if (subClass == HeroSubClass.BERSERKER && 0 < HP && HP <= HT * Fury.LEVEL) {
|
if (subClass == HeroSubClass.BERSERKER && 0 < HP && HP <= HT * Fury.LEVEL) {
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
@ -292,7 +293,7 @@ public abstract class Mob extends Char {
|
||||||
state = State.HUNTING;
|
state = State.HUNTING;
|
||||||
} else if (buff instanceof Terror) {
|
} else if (buff instanceof Terror) {
|
||||||
state = State.FLEEING;
|
state = State.FLEEING;
|
||||||
} else if (buff instanceof Sleep) {
|
} else if (buff instanceof Sleep || buff instanceof MagicalSleep) {
|
||||||
if (sprite != null) {
|
if (sprite != null) {
|
||||||
new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
|
new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
@ -45,24 +46,16 @@ public class ScrollOfLullaby extends Scroll {
|
||||||
Mob affected = null;
|
Mob affected = null;
|
||||||
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
|
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
|
||||||
if (Level.fieldOfView[mob.pos]) {
|
if (Level.fieldOfView[mob.pos]) {
|
||||||
Buff.affect( mob, Sleep.class );
|
Buff.affect( mob, Drowsy.class );
|
||||||
if (mob.buff( Sleep.class ) != null) {
|
if (mob.buff( Drowsy.class ) != null) {
|
||||||
affected = mob;
|
affected = mob;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (count) {
|
GLog.i( "The scroll utters a soothing melody. You feel very sleepy." );
|
||||||
case 0:
|
|
||||||
GLog.i( "The scroll utters a soothing melody." );
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
GLog.i( "The scroll utters a soothing melody and the " + affected.name + " falls asleep!" );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
GLog.i( "The scroll utters a soothing melody and the monsters fall asleep!" );
|
|
||||||
}
|
|
||||||
setKnown();
|
setKnown();
|
||||||
|
|
||||||
curUser.spendAndNext( TIME_TO_READ );
|
curUser.spendAndNext( TIME_TO_READ );
|
||||||
|
@ -71,8 +64,7 @@ public class ScrollOfLullaby extends Scroll {
|
||||||
@Override
|
@Override
|
||||||
public String desc() {
|
public String desc() {
|
||||||
return
|
return
|
||||||
"A soothing melody will put all creatures in your field of view into a deep sleep, " +
|
"A soothing melody will lull all who hear it into a deep magical sleep ";
|
||||||
"giving you a chance to flee or make a surprise attack on them.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -100,6 +100,8 @@ public class TitleScene extends PixelScene {
|
||||||
};
|
};
|
||||||
btnHighscores.setPos( w / 2, btnPlay.top() );
|
btnHighscores.setPos( w / 2, btnPlay.top() );
|
||||||
add( btnHighscores );
|
add( btnHighscores );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BitmapText version = new BitmapText( "v " + Game.version, font1x );
|
BitmapText version = new BitmapText( "v " + Game.version, font1x );
|
||||||
version.measure();
|
version.measure();
|
||||||
|
@ -107,6 +109,13 @@ public class TitleScene extends PixelScene {
|
||||||
version.x = w - version.width();
|
version.x = w - version.width();
|
||||||
version.y = h - version.height();
|
version.y = h - version.height();
|
||||||
add( version );
|
add( version );
|
||||||
|
|
||||||
|
BitmapText source = new BitmapText( "PD source v 1.7.1c", font1x );
|
||||||
|
source.measure();
|
||||||
|
source.hardlight( 0x292929 );
|
||||||
|
source.x = w - source.width();
|
||||||
|
source.y = h - source.height();
|
||||||
|
add( source );
|
||||||
|
|
||||||
PrefsButton btnPrefs = new PrefsButton();
|
PrefsButton btnPrefs = new PrefsButton();
|
||||||
btnPrefs.setPos( w - btnPrefs.width() - 1, 1 );
|
btnPrefs.setPos( w - btnPrefs.width() - 1, 1 );
|
||||||
|
|
|
@ -62,6 +62,8 @@ public class BuffIndicator extends Component {
|
||||||
public static final int BLEEDING = 26;
|
public static final int BLEEDING = 26;
|
||||||
public static final int MARK = 27;
|
public static final int MARK = 27;
|
||||||
public static final int DEFERRED = 28;
|
public static final int DEFERRED = 28;
|
||||||
|
public static final int DROWSY = 29;
|
||||||
|
public static final int MAGIC_SLEEP = 30;
|
||||||
|
|
||||||
public static final int SIZE = 7;
|
public static final int SIZE = 7;
|
||||||
|
|
||||||
|
|