Skip to content

Commit

Permalink
fireball & sorch working
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrieve committed Aug 31, 2024
1 parent 8160d79 commit f2a5268
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 7 deletions.
80 changes: 80 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
*.class

# IntelliJ
.idea/
out/
*.iml

# Eclipse
.classpath
.project
.settings/
.vscode/

# maven build target
target/

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# Spriter files
*.autosave.scml
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ModTheSpire.version>3.30.1</ModTheSpire.version>
<!-- *****一定要改 ***** -->
<!-- 改成你的steam安装路径位置,指向steamapps文件夹(该目录安装了杀戮尖塔及mod) -->
<Steam.path>D:\SteamLibrary\steamapps</Steam.path>
<Steam.path>C:\Program Files (x86)\Steam\steamapps</Steam.path>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
41 changes: 41 additions & 0 deletions src/main/java/jaina/actions/ApplySorchedAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package jaina.actions;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.animations.VFXAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.vfx.FireBurstParticleEffect;
import jaina.powers.SorchedPower;
import jaina.powers.unique.FlameWardPower;
import jaina.powers.unique.WildfirePower;

public class ApplySorchedAction extends AbstractGameAction {

public ApplySorchedAction(AbstractCreature source, AbstractCreature target, int amount) {
this.source = source;
this.target = target;
this.amount = amount;
this.actionType = ActionType.DEBUFF;
}

@Override
public void update() {
if (source.isPlayer && !target.isDying && !target.halfDead && !target.isDead) {
// 野火给予额外层数
// if (source.hasPower(WildfirePower.POWER_ID)) {
// int extra = source.getPower(WildfirePower.POWER_ID).amount;
// amount += extra;
// }
// 给予燃烧
addToBot(new VFXAction(new FireBurstParticleEffect(target.hb_x, target.hb_y)));
addToBot(new ApplyPowerAction(target, source, new SorchedPower(target, amount)));
// 判断是否获得格挡
// if (source.hasPower(FlameWardPower.POWER_ID)) {
// int block = source.getPower(FlameWardPower.POWER_ID).amount;
// addToBot(new GainBlockAction(source, Math.abs(block * amount)));
// }
}
this.isDone = true;
}
}
30 changes: 30 additions & 0 deletions src/main/java/jaina/cards/AbstractFireCard.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
package jaina.cards;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

import jaina.actions.ApplySorchedAction;
import jaina.modCore.IHelper;
import jaina.modCore.JainaEnums;
import jaina.powers.FrozenPower;
import jaina.powers.SorchedPower;

import java.util.List;

Expand Down Expand Up @@ -30,4 +40,24 @@ public AbstractFireCard(String ID, boolean useTestArt, CardStrings cardStrings,
public List<String> getCardDescriptors() {
return getCardDescriptors(SPELL_TYPE);
}

public void dealFireDamage(AbstractPlayer p, AbstractMonster mo) {
dealDamage(mo, AbstractGameAction.AttackEffect.FIRE);
addToBot(new ApplySorchedAction(p, mo, magicNumber));
}

public void calculateFireDamage(AbstractMonster mo) {
int originalBaseDamage = this.baseDamage;

if (mo.hasPower(SorchedPower.POWER_ID)) {
this.baseDamage += mo.getPower(SorchedPower.POWER_ID).amount;
}

super.calculateCardDamage(mo);

this.baseDamage = originalBaseDamage;
this.isDamageModified = this.damage != this.baseDamage;

this.initializeDescription();
}
}
21 changes: 16 additions & 5 deletions src/main/java/jaina/cards/Fireball.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,48 @@
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.vfx.combat.FireballEffect;

import jaina.actions.ApplySorchedAction;
import jaina.modCore.IHelper;
import jaina.modCore.JainaEnums;
import jaina.powers.SorchedPower;

public class Fireball extends AbstractFireCard {

public static final String ID = IHelper.makeID("Fireball");
private static final CardStrings CARD_STRINGS = CardCrawlGame.languagePack.getCardStrings(ID);
private static final int COST = 1;
private static final int COST = 2;

public Fireball() {
super(ID, false, CARD_STRINGS, COST, CardType.ATTACK, JainaEnums.JAINA_COLOR,
CardRarity.COMMON, CardTarget.ENEMY);
setDamage(10);
setDamage(14);
setMagicNumber(7);
}

@Override
public void use(AbstractPlayer p, AbstractMonster m) {
addToBot(new VFXAction(new FireballEffect(p.hb_x, p.hb_y, m.hb_x, m.hb_y)));
dealDamage(m, AbstractGameAction.AttackEffect.FIRE);
}
dealFireDamage(p, m);
}

@Override
public void upp() {
upgradeDamage(3);
upgradeDamage(6);
upgradeMagicNumber(3);
}

@Override
public AbstractCard makeCopy() {
return new Fireball();
}

@Override
public void calculateCardDamage(AbstractMonster mo) {
calculateFireDamage(mo);
}
}
77 changes: 77 additions & 0 deletions src/main/java/jaina/powers/SorchedPower.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package jaina.powers;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.animations.VFXAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.StrengthPower;
import com.megacrit.cardcrawl.rooms.AbstractRoom;
import com.megacrit.cardcrawl.vfx.FireBurstParticleEffect;
import jaina.modCore.IHelper;
import jaina.powers.unique.ExplosiveRunesPower;

public class SorchedPower extends AbstractJainaPower {
public static final String POWER_ID = IHelper.makeID("SorchedPower");
private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
private static final String NAME = powerStrings.NAME;
private static final String[] DESCRIPTIONS = powerStrings.DESCRIPTIONS;

public SorchedPower(AbstractCreature owner, int amount) {
super(POWER_ID, false, NAME, PowerType.DEBUFF);
this.owner = owner;
this.amount = amount;
updateDescription();
}

@Override
public void reducePower(int reduceAmount) {
super.reducePower(reduceAmount);
if (amount <= 0) {
addToBot(new RemoveSpecificPowerAction(this.owner, this.owner, this));
}
}


@Override
public void onInitialApplication() {
addToBot(new VFXAction(new FireBurstParticleEffect(owner.hb.x, owner.hb.y)));
}

// 可以由外部触发
@Override
public void onSpecificTrigger() {
if (!owner.isDying && !owner.isDeadOrEscaped()) {
flash();
addToBot(new DamageAction(owner, new DamageInfo(owner, amount, DamageInfo.DamageType.HP_LOSS),
AbstractGameAction.AttackEffect.FIRE));
}
}

// 回合结束时自动触发
@Override
public void atEndOfTurn(boolean isPlayer) {
this.flash();
this.addToBot(new ApplyPowerAction(this.owner, this.owner, new SorchedPower(this.owner, -this.amount), -this.amount));
this.addToBot(new RemoveSpecificPowerAction(this.owner, this.owner, this));
}

@Override
public void atStartOfTurn() {
// if (AbstractDungeon.getCurrRoom().phase == AbstractRoom.RoomPhase.COMBAT && !AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
// onSpecificTrigger();
// addToBot(new RemoveSpecificPowerAction(this.owner, this.owner, this));
// }
}

@Override
public void updateDescription() {
this.description = String.format(DESCRIPTIONS[0], amount, amount);
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/Jaina/localization/ENG/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
},
"jaina:Fireball": {
"NAME": "Fireball",
"DESCRIPTION": "Deal !D! damage."
"DESCRIPTION": "Deal !D! damage. NL Apply !M! jaina:Sorched."
},
"jaina:Fireblast": {
"NAME": "Fireblast",
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/Jaina/localization/ENG/keywords.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
"PROPER_NAME": "Burning",
"DESCRIPTION": "#yBurning creatures will lose HP at the end of their turn. NL Removed if #yFrozen is applied to the same creature."
},
{
"NAMES": [
"Sorched",
"sorched"
],
"PROPER_NAME": "Sorched",
"DESCRIPTION": "#ySorched creatures will lose HP at the start of their turn. Sorced is reduced in halve rounded down."
},
{
"NAMES": [
"Purge",
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/Jaina/localization/ENG/powers.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
"Your next #b%d #yArcane cards are played twice this turn."
]
},
"jaina:SorchedPower": {
"NAME": "Sorched",
"DESCRIPTIONS": [
"#bFire spells deal #b%d extra damage. At the end of this turn, lose #b%d #ySorch."
]
},
"jaina:SpellForcePower": {
"NAME": "Spell Force",
"DESCRIPTIONS": [
Expand Down

0 comments on commit f2a5268

Please sign in to comment.