From b21f9c0fe2ea3303b43b583070a8a0485840ef93 Mon Sep 17 00:00:00 2001 From: NJ_CENY <2662575513@qq.com> Date: Thu, 12 May 2022 21:17:01 +0800 Subject: [PATCH] feat: rice-noodle_relic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 加入“螺蛳粉”遗物 --- .../java/org/ctm/characters/CTMCharacter.java | 6 ++- .../java/org/ctm/constant/RelicConstant.java | 3 +- src/main/java/org/ctm/mod/CTMMod.java | 3 ++ .../org/ctm/relics/ctm/RiceNoodlesRelic.java | 45 +++++++++++++++++++ .../localization/ctm/ctm_relics-zh.json | 7 +++ 5 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 src/main/java/org/ctm/relics/ctm/RiceNoodlesRelic.java diff --git a/src/main/java/org/ctm/characters/CTMCharacter.java b/src/main/java/org/ctm/characters/CTMCharacter.java index 470b375..1bdae3d 100644 --- a/src/main/java/org/ctm/characters/CTMCharacter.java +++ b/src/main/java/org/ctm/characters/CTMCharacter.java @@ -143,8 +143,10 @@ public class CTMCharacter extends CustomPlayer { @Override public ArrayList getStartingRelics() { ArrayList retVal = new ArrayList<>(); - retVal.add(RelicConstant.ChaosCoreRelic.ID()); - UnlockTracker.markRelicAsSeen(RelicConstant.ChaosCoreRelic.ID()); + RelicConstant start_relic = RelicConstant.ChaosCoreRelic; + // RelicConstant.ChaosCoreRelic + retVal.add(start_relic.ID()); + UnlockTracker.markRelicAsSeen(start_relic.ID()); return retVal; } diff --git a/src/main/java/org/ctm/constant/RelicConstant.java b/src/main/java/org/ctm/constant/RelicConstant.java index 7850278..acd77e6 100644 --- a/src/main/java/org/ctm/constant/RelicConstant.java +++ b/src/main/java/org/ctm/constant/RelicConstant.java @@ -9,7 +9,8 @@ import com.megacrit.cardcrawl.powers.AbstractPower; import org.ctm.util.TextureLoader; public enum RelicConstant { - ChaosCoreRelic("ChaosCoreRelic", "placeholder_relic.png", "placeholder_relic.png"); + ChaosCoreRelic("ChaosCoreRelic", "placeholder_relic.png", "placeholder_relic.png"), + RiceNoodlesRelic("RiceNoodlesRelic", "placeholder_relic.png", "placeholder_relic.png"); private final String id_; private final String img_path_; diff --git a/src/main/java/org/ctm/mod/CTMMod.java b/src/main/java/org/ctm/mod/CTMMod.java index db631fd..a7373aa 100644 --- a/src/main/java/org/ctm/mod/CTMMod.java +++ b/src/main/java/org/ctm/mod/CTMMod.java @@ -34,6 +34,7 @@ import org.ctm.constant.RelicConstant; import org.ctm.enums.AbstractCardEnum; import org.ctm.enums.ThmodClassEnum; import org.ctm.relics.ctm.ChaosCoreRelic; +import org.ctm.relics.ctm.RiceNoodlesRelic; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -194,7 +195,9 @@ public class CTMMod implements RelicGetSubscriber, PostPowerApplySubscriber, Pos @Override public void receiveEditRelics() { BaseMod.addRelicToCustomPool(new ChaosCoreRelic(), AbstractCardEnum.CTM_COLOR); + BaseMod.addRelicToCustomPool(new RiceNoodlesRelic(), AbstractCardEnum.CTM_COLOR); UnlockTracker.markRelicAsSeen(RelicConstant.ChaosCoreRelic.ID()); + UnlockTracker.markRelicAsSeen(RelicConstant.RiceNoodlesRelic.ID()); } @Override diff --git a/src/main/java/org/ctm/relics/ctm/RiceNoodlesRelic.java b/src/main/java/org/ctm/relics/ctm/RiceNoodlesRelic.java new file mode 100644 index 0000000..8aa6f83 --- /dev/null +++ b/src/main/java/org/ctm/relics/ctm/RiceNoodlesRelic.java @@ -0,0 +1,45 @@ +package org.ctm.relics.ctm; + +import basemod.abstracts.CustomRelic; +import com.megacrit.cardcrawl.actions.AbstractGameAction; +import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; +import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.characters.AbstractPlayer; +import com.megacrit.cardcrawl.core.AbstractCreature; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.monsters.AbstractMonster; +import com.megacrit.cardcrawl.powers.*; +import org.ctm.constant.RelicConstant; + +import java.util.Iterator; + +// 战斗开始时获得 #b1 点力量和 #b1 层中毒,并赋予敌方 #b3 层中毒和 #b1 层虚弱 +public class RiceNoodlesRelic extends CustomRelic { + private static final int TOXIC_AMOUNT = 3; + private static final int SELF_TOXIC_AMOUNT = 2; + private static final int WEAK_AMOUNT = 1; + private static final int STRENGTH_AMOUNT = 1; + public RiceNoodlesRelic() { + super(RelicConstant.RiceNoodlesRelic.ID(), RelicConstant.RiceNoodlesRelic.Image(), + RelicConstant.RiceNoodlesRelic.Outline(), RelicTier.RARE, LandingSound.FLAT); + this.description = RelicConstant.RiceNoodlesRelic.Description(); + } + + @Override + public void atBattleStart() { + this.flash(); + AbstractPlayer player = AbstractDungeon.player; + this.addToBot(new ApplyPowerAction(player, player, new PoisonPower(player, player, SELF_TOXIC_AMOUNT), SELF_TOXIC_AMOUNT)); + this.addToBot(new ApplyPowerAction(player, player, new StrengthPower(player, STRENGTH_AMOUNT))); + + Iterator var1 = AbstractDungeon.getMonsters().monsters.iterator(); + while(var1.hasNext()) { + AbstractMonster m = (AbstractMonster)var1.next(); + if (!m.isDead && !m.isDying) { + this.addToBot(new ApplyPowerAction(m, player, new WeakPower(m, WEAK_AMOUNT, false), WEAK_AMOUNT, true, AbstractGameAction.AttackEffect.NONE)); + this.addToBot(new ApplyPowerAction(m, player, new PoisonPower(m, player, TOXIC_AMOUNT), TOXIC_AMOUNT)); + } + } + } +} diff --git a/src/main/resources/localization/ctm/ctm_relics-zh.json b/src/main/resources/localization/ctm/ctm_relics-zh.json index ac4af1c..125f13a 100644 --- a/src/main/resources/localization/ctm/ctm_relics-zh.json +++ b/src/main/resources/localization/ctm/ctm_relics-zh.json @@ -5,5 +5,12 @@ "DESCRIPTIONS": [ "赋予角色掌控 #y阴 #y阳 的能力。" ] + }, + "RiceNoodlesRelic": { + "NAME": "螺蛳粉", + "FLAVOR": "三花牌螺蛳粉。", + "DESCRIPTIONS": [ + "战斗开始时获得 #b1 点力量,并赋予敌方 #b3 层中毒和 #b1 层虚弱。" + ] } } \ No newline at end of file -- Gitee