From 47262359f068bfeebac7dab2c43806025480e69b Mon Sep 17 00:00:00 2001 From: zxcPandora <1158500986@qq.com> Date: Sun, 15 Oct 2023 22:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=9F=E8=B0=A2=E7=BB=AB=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E7=9A=84=E8=80=81=E9=AD=94=E6=9D=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/testmode/SpawnWeapon.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/testmode/SpawnWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/testmode/SpawnWeapon.java index 28ede869c..9ef385d9e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/testmode/SpawnWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/custom/testmode/SpawnWeapon.java @@ -8,6 +8,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.custom.messages.M; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing; @@ -32,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projec import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Unstable; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -104,7 +106,12 @@ public class SpawnWeapon extends TestItem{ } wpn.cursed=cursed; wpn.identify(); - if(wpn.collect()) { + if(wpn instanceof MagesStaff){ + wpn=new MagesStaff(new WandOfMagicMissile()); + wpn.identify(); + GameScene.pickUp(wpn,hero.pos); + Sample.INSTANCE.play(Assets.Sounds.ITEM); + } else if(wpn.collect()) { GameScene.pickUp( wpn, hero.pos ); Sample.INSTANCE.play( Assets.Sounds.ITEM ); GLog.i(Messages.get(hero, "you_now_have", wpn.name())); @@ -321,7 +328,7 @@ public class SpawnWeapon extends TestItem{ Button_Level = new RedButton(Messages.get(this, "select_weapon")) { @Override protected void onClick() { - if(!Button_Level.text().equals(Messages.get(SpawnWeapon.WeaponSetting.class, "select_weapon"))){ + if(!Button_Level.text().equals(Messages.get(SpawnWeapon.WeaponSetting.class, "select_weapon"))){ // 修改此行代码 Game.runOnRenderThread(() -> ShatteredPixelDungeon.scene().add(new WndTextNumberInput( Messages.get(SpawnWeapon.WeaponSetting.class, "weapon_level"), Messages.get(SpawnWeapon.WeaponSetting.class, "weapon_level_desc"), Integer.toString(weapon_level),