Merge remote-tracking branch 'origin/master'

This commit is contained in:
Evan Debenham 2014-08-11 19:18:14 -04:00
commit 2fd0967619
16 changed files with 141 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -235,6 +235,9 @@ public abstract class Char extends Actor {
Buff.prolong(this, Paralysis.class, 1f);
}
}
if (this.buff(MagicalSleep.class) != null){
Buff.detach(this, MagicalSleep.class);
}
Class<?> srcClass = src.getClass();
if (immunities().contains( srcClass )) {

View File

@ -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";
}
}

View File

@ -20,13 +20,11 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
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.food.FrozenCarpaccio;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Random;
public class Frost extends FlavourBuff {

View File

@ -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";
}
}

View File

@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
import java.util.ArrayList;
import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.audio.Sample;
@ -821,6 +822,10 @@ public class Hero extends Char {
@Override
public void damage( int dmg, Object src ) {
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 );
if (subClass == HeroSubClass.BERSERKER && 0 < HP && HP <= HT * Fury.LEVEL) {

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
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.MagicalSleep;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -292,7 +293,7 @@ public abstract class Mob extends Char {
state = State.HUNTING;
} else if (buff instanceof Terror) {
state = State.FLEEING;
} else if (buff instanceof Sleep) {
} else if (buff instanceof Sleep || buff instanceof MagicalSleep) {
if (sprite != null) {
new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
}

View File

@ -17,6 +17,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
@ -45,24 +46,16 @@ public class ScrollOfLullaby extends Scroll {
Mob affected = null;
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
if (Level.fieldOfView[mob.pos]) {
Buff.affect( mob, Sleep.class );
if (mob.buff( Sleep.class ) != null) {
Buff.affect( mob, Drowsy.class );
if (mob.buff( Drowsy.class ) != null) {
affected = mob;
count++;
}
}
}
switch (count) {
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!" );
}
GLog.i( "The scroll utters a soothing melody. You feel very sleepy." );
setKnown();
curUser.spendAndNext( TIME_TO_READ );
@ -71,8 +64,7 @@ public class ScrollOfLullaby extends Scroll {
@Override
public String desc() {
return
"A soothing melody will put all creatures in your field of view into a deep sleep, " +
"giving you a chance to flee or make a surprise attack on them.";
"A soothing melody will lull all who hear it into a deep magical sleep ";
}
@Override

View File

@ -101,6 +101,8 @@ public class TitleScene extends PixelScene {
btnHighscores.setPos( w / 2, btnPlay.top() );
add( btnHighscores );
BitmapText version = new BitmapText( "v " + Game.version, font1x );
version.measure();
version.hardlight( 0x888888 );
@ -108,6 +110,13 @@ public class TitleScene extends PixelScene {
version.y = h - version.height();
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();
btnPrefs.setPos( w - btnPrefs.width() - 1, 1 );
add( btnPrefs );

View File

@ -62,6 +62,8 @@ public class BuffIndicator extends Component {
public static final int BLEEDING = 26;
public static final int MARK = 27;
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;