v1.4.0: improved chains vfx, especially for guards
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 365 B |
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Effects;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
@@ -95,7 +96,10 @@ public class Guard extends Mob {
|
|||||||
yell(Messages.get(this, "scorpion"));
|
yell(Messages.get(this, "scorpion"));
|
||||||
new Item().throwSound();
|
new Item().throwSound();
|
||||||
Sample.INSTANCE.play(Assets.Sounds.CHAINS);
|
Sample.INSTANCE.play(Assets.Sounds.CHAINS);
|
||||||
sprite.parent.add(new Chains(sprite.center(), enemy.sprite.destinationCenter(), new Callback() {
|
sprite.parent.add(new Chains(sprite.center(),
|
||||||
|
enemy.sprite.destinationCenter(),
|
||||||
|
Effects.Type.CHAIN,
|
||||||
|
new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
Actor.addDelayed(new Pushing(enemy, enemy.pos, newPosFinal, new Callback() {
|
Actor.addDelayed(new Pushing(enemy, enemy.pos, newPosFinal, new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
|
|||||||
@@ -44,13 +44,14 @@ public class Chains extends Group {
|
|||||||
|
|
||||||
private PointF from, to;
|
private PointF from, to;
|
||||||
|
|
||||||
public Chains(int from, int to, Callback callback){
|
public Chains(int from, int to, Effects.Type type, Callback callback){
|
||||||
this(DungeonTilemap.tileCenterToWorld(from),
|
this(DungeonTilemap.tileCenterToWorld(from),
|
||||||
DungeonTilemap.tileCenterToWorld(to),
|
DungeonTilemap.tileCenterToWorld(to),
|
||||||
|
type,
|
||||||
callback);
|
callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Chains(PointF from, PointF to, Callback callback){
|
public Chains(PointF from, PointF to, Effects.Type type, Callback callback){
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
@@ -62,8 +63,8 @@ public class Chains extends Group {
|
|||||||
float dy = to.y - from.y;
|
float dy = to.y - from.y;
|
||||||
distance = (float)Math.hypot(dx, dy);
|
distance = (float)Math.hypot(dx, dy);
|
||||||
|
|
||||||
|
//base of 200ms, plus 50ms per tile travelled
|
||||||
duration = distance/300f + 0.1f;
|
duration = distance/320f + 0.2f;
|
||||||
|
|
||||||
rotation = (float)(Math.atan2( dy, dx ) * A) + 90f;
|
rotation = (float)(Math.atan2( dy, dx ) * A) + 90f;
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ public class Chains extends Group {
|
|||||||
|
|
||||||
chains = new Image[numChains];
|
chains = new Image[numChains];
|
||||||
for (int i = 0; i < chains.length; i++){
|
for (int i = 0; i < chains.length; i++){
|
||||||
chains[i] = new Image(Effects.get(Effects.Type.CHAIN));
|
chains[i] = new Image(Effects.get(type));
|
||||||
chains[i].angle = rotation;
|
chains[i].angle = rotation;
|
||||||
chains[i].origin.set( chains[i].width()/ 2, chains[i].height() );
|
chains[i].origin.set( chains[i].width()/ 2, chains[i].height() );
|
||||||
add(chains[i]);
|
add(chains[i]);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class Effects {
|
|||||||
WOUND,
|
WOUND,
|
||||||
EXCLAMATION,
|
EXCLAMATION,
|
||||||
CHAIN,
|
CHAIN,
|
||||||
|
ETHEREAL_CHAIN,
|
||||||
DEATH_RAY,
|
DEATH_RAY,
|
||||||
LIGHT_RAY,
|
LIGHT_RAY,
|
||||||
HEALTH_RAY
|
HEALTH_RAY
|
||||||
@@ -55,6 +56,9 @@ public class Effects {
|
|||||||
case CHAIN:
|
case CHAIN:
|
||||||
icon.frame(icon.texture.uvRect(6, 16, 11, 22));
|
icon.frame(icon.texture.uvRect(6, 16, 11, 22));
|
||||||
break;
|
break;
|
||||||
|
case ETHEREAL_CHAIN:
|
||||||
|
icon.frame(icon.texture.uvRect(11, 16, 16, 22));
|
||||||
|
break;
|
||||||
case DEATH_RAY:
|
case DEATH_RAY:
|
||||||
icon.frame(icon.texture.uvRect(16, 16, 32, 24));
|
icon.frame(icon.texture.uvRect(16, 16, 32, 24));
|
||||||
break;
|
break;
|
||||||
|
|||||||
+9
-2
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Effects;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
@@ -176,7 +177,10 @@ public class EtherealChains extends Artifact {
|
|||||||
hero.busy();
|
hero.busy();
|
||||||
throwSound();
|
throwSound();
|
||||||
Sample.INSTANCE.play( Assets.Sounds.CHAINS );
|
Sample.INSTANCE.play( Assets.Sounds.CHAINS );
|
||||||
hero.sprite.parent.add(new Chains(hero.sprite.center(), enemy.sprite.center(), new Callback() {
|
hero.sprite.parent.add(new Chains(hero.sprite.center(),
|
||||||
|
enemy.sprite.center(),
|
||||||
|
Effects.Type.ETHEREAL_CHAIN,
|
||||||
|
new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
Actor.add(new Pushing(enemy, enemy.pos, pulledPos, new Callback() {
|
Actor.add(new Pushing(enemy, enemy.pos, pulledPos, new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
@@ -236,7 +240,10 @@ public class EtherealChains extends Artifact {
|
|||||||
hero.busy();
|
hero.busy();
|
||||||
throwSound();
|
throwSound();
|
||||||
Sample.INSTANCE.play( Assets.Sounds.CHAINS );
|
Sample.INSTANCE.play( Assets.Sounds.CHAINS );
|
||||||
hero.sprite.parent.add(new Chains(hero.sprite.center(), DungeonTilemap.raisedTileCenterToWorld(newHeroPos), new Callback() {
|
hero.sprite.parent.add(new Chains(hero.sprite.center(),
|
||||||
|
DungeonTilemap.raisedTileCenterToWorld(newHeroPos),
|
||||||
|
Effects.Type.ETHEREAL_CHAIN,
|
||||||
|
new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
Actor.add(new Pushing(hero, hero.pos, newHeroPos, new Callback() {
|
Actor.add(new Pushing(hero, hero.pos, newHeroPos, new Callback() {
|
||||||
public void call() {
|
public void call() {
|
||||||
|
|||||||
Reference in New Issue
Block a user