-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from GraysonnG/develop
Merge Develop into Master 11/16/18
- Loading branch information
Showing
23 changed files
with
681 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/infinitespire/actions/DeathsTouchAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package infinitespire.actions; | ||
|
||
import com.megacrit.cardcrawl.actions.AbstractGameAction; | ||
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; | ||
import com.megacrit.cardcrawl.actions.common.DamageAction; | ||
import com.megacrit.cardcrawl.cards.DamageInfo; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
import com.megacrit.cardcrawl.powers.PoisonPower; | ||
import com.megacrit.cardcrawl.relics.ChemicalX; | ||
import com.megacrit.cardcrawl.ui.panels.EnergyPanel; | ||
|
||
public class DeathsTouchAction extends AbstractGameAction { | ||
|
||
private AbstractPlayer p; | ||
private AbstractMonster m; | ||
private int damage; | ||
private int magicNumber; | ||
private DamageInfo.DamageType damageType; | ||
private boolean isFree; | ||
private int energyAmount; | ||
|
||
public DeathsTouchAction(AbstractPlayer player, AbstractMonster monster, int damage, int magicNumber, DamageInfo.DamageType damageType, boolean freeToPlayOnce, int energyOnUse) { | ||
this.p = player; | ||
this.m = monster; | ||
this.damage = damage; | ||
this.target = monster; | ||
this.magicNumber = magicNumber; | ||
this.damageType = damageType; | ||
this.isFree = freeToPlayOnce; | ||
this.energyAmount = energyOnUse; | ||
this.duration = Settings.ACTION_DUR_XFAST; | ||
this.actionType = ActionType.SPECIAL; | ||
} | ||
|
||
@Override | ||
public void update() { | ||
int effect = EnergyPanel.totalCount; | ||
if(this.energyAmount != -1) { | ||
effect = this.energyAmount; | ||
} | ||
|
||
effect += 1; //this is the + 1 part of the X + 1 | ||
|
||
if(this.p.hasRelic(ChemicalX.ID)) { | ||
this.p.getRelic(ChemicalX.ID).flash(); | ||
effect += 2; | ||
} | ||
|
||
AbstractDungeon.actionManager.addToBottom(new DamageAction(m, new DamageInfo(p, this.damage, this.damageType), AttackEffect.SLASH_DIAGONAL)); | ||
|
||
if(effect > 0) { | ||
for(int i = 0; i < effect; i++) { | ||
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new PoisonPower(m, p, this.magicNumber), this.magicNumber)); | ||
} | ||
|
||
if(!this.isFree) { | ||
this.p.energy.use(EnergyPanel.totalCount); | ||
} | ||
} | ||
|
||
this.isDone = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package infinitespire.cards.black; | ||
|
||
import com.megacrit.cardcrawl.actions.animations.VFXAction; | ||
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
import infinitespire.abstracts.BlackCard; | ||
import infinitespire.effects.uniqueVFX.MenacingEffect; | ||
import infinitespire.powers.MenacingPower; | ||
|
||
public class Menacing extends BlackCard { | ||
private static final String ID = "Menacing"; | ||
private static final String NAME = "Menacing"; | ||
private static final String TEXTURE = "img/infinitespire/cards/menacing.png"; | ||
private static final int COST = 1; | ||
private static final String DESCRIPTION = "The next attack you play stuns any enemy it hits for 1 turn. NL Exhaust."; | ||
private static final String UPG_DESCRIPTION = "The next !M! attacks you play stun any enemy they hit for 1 turn. NL Exhaust."; | ||
private static final CardType TYPE = CardType.SKILL; | ||
private static final CardTarget TARGET = CardTarget.SELF; | ||
private static final int MAGIC = 1; | ||
|
||
public Menacing() { | ||
super(ID, NAME, TEXTURE, COST, DESCRIPTION, TYPE, TARGET); | ||
this.baseMagicNumber = MAGIC; | ||
this.magicNumber = MAGIC; | ||
this.exhaust = true; | ||
} | ||
|
||
@Override | ||
public void upgrade() { | ||
if(!upgraded) { | ||
this.upgradeName(); | ||
this.upgradeMagicNumber(1); | ||
this.rawDescription = UPG_DESCRIPTION; | ||
this.initializeDescription(); | ||
} | ||
} | ||
|
||
@Override | ||
public void useWithEffect(AbstractPlayer p, AbstractMonster m) { | ||
AbstractDungeon.actionManager.addToBottom(new VFXAction(new MenacingEffect(), 0.5f)); | ||
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new MenacingPower(p, magicNumber))); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
src/main/java/infinitespire/effects/uniqueVFX/MenacingEffect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package infinitespire.effects.uniqueVFX; | ||
|
||
import com.badlogic.gdx.Gdx; | ||
import com.badlogic.gdx.graphics.Color; | ||
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | ||
import com.badlogic.gdx.math.Vector2; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.random.Random; | ||
import com.megacrit.cardcrawl.vfx.AbstractGameEffect; | ||
import infinitespire.InfiniteSpire; | ||
|
||
import java.util.ArrayList; | ||
|
||
|
||
public class MenacingEffect extends AbstractGameEffect { | ||
private static final float PARTICLE_SIZE = 0.3f; | ||
private static final float PARTICLE_SIZE_SUB = 0.1f; | ||
private static final float PARTICLE_MAX_SIZE = 0.45f; | ||
private static final float PARTICLE_MIN_SIZE = 0.1f; | ||
private static final float PARTICLE_JITTER_SIZE = 0.025f; | ||
|
||
|
||
private int amountOfMenace; | ||
private ArrayList<MenaceParticle> particles = new ArrayList<>(); | ||
|
||
public MenacingEffect() { | ||
this.amountOfMenace = 3; | ||
|
||
for(int i = 0; i < amountOfMenace; i++){ | ||
Vector2 pos = getPositionOnCircle(i); | ||
MenaceParticle particle = new MenaceParticle(pos.x, pos.y, PARTICLE_SIZE * Settings.scale - (PARTICLE_SIZE_SUB * Settings.scale * (i)), 0.5f); | ||
particles.add(particle); | ||
} | ||
} | ||
|
||
private Vector2 getPositionOnCircle(int pos){ | ||
Vector2 result = new Vector2(); | ||
result.x = AbstractDungeon.player.hb.cX + (AbstractDungeon.player.hb.width / 4f) * (float) Math.cos(15.0 * pos); | ||
result.y = AbstractDungeon.player.hb.cY + (AbstractDungeon.player.hb.height / 4f) * (float) Math.sin(15.0 * pos); | ||
return result; | ||
} | ||
|
||
@Override | ||
public void update() { | ||
for(MenaceParticle particle : particles){ | ||
particle.update(); | ||
} | ||
particles.removeIf(MenaceParticle::isDead); | ||
if(particles.size() <= 0) { | ||
this.isDone = true; | ||
} | ||
} | ||
|
||
@Override | ||
public void render(SpriteBatch sb) { | ||
for(MenaceParticle particle : particles){ | ||
particle.render(sb); | ||
} | ||
} | ||
|
||
private static class MenaceParticle { | ||
public float x, y, size, lifeSpan; | ||
|
||
public MenaceParticle(float x, float y, float size, float lifeSpan) { | ||
this.x = x; | ||
this.y = y; | ||
this.size = size; | ||
this.lifeSpan = lifeSpan; | ||
} | ||
|
||
public void update() { | ||
this.lifeSpan -= Gdx.graphics.getDeltaTime(); | ||
size = (new Random()).randomBoolean() ? size - PARTICLE_JITTER_SIZE * Settings.scale : size + PARTICLE_JITTER_SIZE * Settings.scale; | ||
if(size < PARTICLE_MIN_SIZE * Settings.scale){ | ||
size = PARTICLE_MIN_SIZE * Settings.scale; | ||
}else if(size > PARTICLE_MAX_SIZE * Settings.scale){ | ||
size = PARTICLE_MAX_SIZE * Settings.scale; | ||
} | ||
} | ||
|
||
public boolean isDead(){ | ||
return lifeSpan <= 0.0f; | ||
} | ||
|
||
public void render(SpriteBatch sb) { | ||
sb.setColor(Color.WHITE.cpy()); | ||
|
||
sb.draw(InfiniteSpire.getTexture("img/infinitespire/vfx/menacing.png"), this.x, this.y, 128f, 128f, 256f, 256f, size, size, 1f, 0, 0, 256, 256, false, false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.