Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Commit

Permalink
ported over 0.7.2d changes, updated version info
Browse files Browse the repository at this point in the history
  • Loading branch information
00-Evan committed Apr 27, 2019
1 parent 67483fa commit b76b235
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 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.
* (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
Expand All @@ -18,17 +18,13 @@
* 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.effects;
package com.watabou.noosa;

import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.watabou.gltextures.SmartTexture;
import com.watabou.gltextures.TextureCache;
import com.watabou.noosa.Image;

import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;

//TODO externalize bitmap stuff to SPD-classes
public class Halo extends Image {

private static final Object CACHE_KEY = Halo.class;
Expand Down Expand Up @@ -65,7 +61,6 @@ public Halo( float radius, int color, float brightness ) {
public Halo point( float x, float y ) {
this.x = x - (width()/2f);
this.y = y - (height()/2f);
PixelScene.align(this);
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '0.7.2c'
version = '0.7.2d'
ext {
versionCode = 339
versionCode = 340
appName = 'shattered-pixel-dungeon'
appTitle = 'Shattered Pixel Dungeon'
appId = 'com.shatteredpixel.shatteredpixeldungeon'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ public void onSelect(Integer cell) {
AttackLevel lvl = AttackLevel.getLvl(turnsInvis);

boolean[] passable = Dungeon.level.passable.clone();
//need to consider enemy cell as passable in case they are on a trap or chasm
passable[cell] = true;
PathFinder.buildDistanceMap(Dungeon.hero.pos, passable, lvl.blinkDistance+1);
if (PathFinder.distance[cell] == Integer.MAX_VALUE){
GLog.w(Messages.get(Preparation.class, "out_of_reach"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

package com.shatteredpixel.shatteredpixeldungeon.effects;

import com.shatteredpixel.shatteredpixeldungeon.effects.Halo;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.watabou.glwrap.Blending;
import com.watabou.noosa.Game;
import com.watabou.noosa.Halo;
import com.watabou.utils.PointF;

public class ShieldHalo extends Halo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.watabou.glwrap.Blending;
import com.watabou.noosa.Game;
import com.watabou.noosa.Halo;

public class TorchHalo extends Halo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public int proc(Armor armor, Char attacker, Char defender, int damage) {

float hitChance;
if (evasion >= accuracy){
hitChance = 1f - (1f - (accuracy/evasion))/2f;
hitChance = (accuracy/evasion)/2f;
} else {
hitChance = 1f - (evasion/accuracy)/2f;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,21 @@ public void detach() {
updateQuickslot();
super.detach();
}

private static final String TURNSTOCOST = "turnsToCost";

@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);

bundle.put( TURNSTOCOST , turnsToCost);
}

@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);

turnsToCost = bundle.getInt( TURNSTOCOST );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void restoreFromBundle( Bundle bundle ) {
if (bundle.contains( BUFF )){
Bundle buffBundle = bundle.getBundle( BUFF );

if (buffBundle.contains( timeFreeze.PARTIALTIME ))
if (buffBundle.contains( timeFreeze.PRESSES ))
activeBuff = new timeFreeze();
else
activeBuff = new timeStasis();
Expand Down Expand Up @@ -289,15 +289,15 @@ public class timeFreeze extends ArtifactBuff {
type = buffType.POSITIVE;
}

float partialTime = 0f;
float turnsToCost = 0f;

ArrayList<Integer> presses = new ArrayList<Integer>();
ArrayList<Integer> presses = new ArrayList<>();

public void processTime(float time){
partialTime += time;
turnsToCost -= time;

while (partialTime >= 2f){
partialTime -= 2f;
while (turnsToCost < 0f){
turnsToCost += 2f;
charge --;
}

Expand Down Expand Up @@ -336,11 +336,6 @@ public void detach(){
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0]))
if (mob.paralysed <= 0) mob.sprite.remove(CharSprite.State.PARALYSED);
GameScene.freezeEmitters = false;

while (partialTime > 0f){
partialTime -= 2f;
charge --;
}

updateQuickslot();
super.detach();
Expand All @@ -350,7 +345,7 @@ public void detach(){
}

private static final String PRESSES = "presses";
private static final String PARTIALTIME = "partialtime";
private static final String TURNSTOCOST = "turnsToCost";

@Override
public void storeInBundle(Bundle bundle) {
Expand All @@ -361,7 +356,7 @@ public void storeInBundle(Bundle bundle) {
values[i] = presses.get(i);
bundle.put( PRESSES , values );

bundle.put( PARTIALTIME , partialTime );
bundle.put( TURNSTOCOST , turnsToCost);
}

@Override
Expand All @@ -372,7 +367,7 @@ public void restoreFromBundle(Bundle bundle) {
for (int value : values)
presses.add(value);

partialTime = bundle.getFloat( PARTIALTIME );
turnsToCost = bundle.getFloat( TURNSTOCOST );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ private void corruptEnemy( Mob enemy ){
buff.detach();
}
}
if (enemy.alignment == Char.Alignment.ENEMY){
enemy.rollToDropLoot();
}

Buff.affect(enemy, Corruption.class);

Statistics.enemiesSlain++;
Expand All @@ -236,9 +240,6 @@ private void corruptEnemy( Mob enemy ){
} else {
curUser.earnExp(0, enemy.getClass());
}
if (enemy.alignment == Char.Alignment.ENEMY){
enemy.rollToDropLoot();
}
} else {
Buff.affect(enemy, Doom.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
import com.shatteredpixel.shatteredpixeldungeon.effects.Halo;
import com.watabou.noosa.Halo;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.PrisonPainter;
Expand Down
4 changes: 2 additions & 2 deletions desktop/VersionInfo.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
339
340
333
v0.7.2c
v0.7.2!
github.com/00-Evan/shattered-pixel-dungeon-gdx/releases/download/v0.7.2c/ShatteredPD.Desktop.v0.7.2c.jar
github.com/00-Evan/shattered-pixel-dungeon-gdx/releases/download/v0.7.2d/ShatteredPD.Desktop.v0.7.2d.jar
4 changes: 2 additions & 2 deletions desktop/src/com/watabou/pd/desktop/DesktopLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class DesktopLauncher {
public static void main (String[] arg) {
String version = DesktopLauncher.class.getPackage().getSpecificationVersion();
if (version == null) {
version = "0.7.2c";
version = "0.7.2d";
}

int versionCode;
try {
versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
} catch (NumberFormatException e) {
versionCode = 339;
versionCode = 340;
}

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
Expand Down

0 comments on commit b76b235

Please sign in to comment.