From 697a16fd9438a7b40134e8e93d2b0b454507fc76 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 23 Feb 2023 14:34:15 -0500 Subject: [PATCH] v2.0.0: implemented base Monk class and basic energy buff logic --- core/src/main/assets/interfaces/buffs.png | Bin 1613 -> 1631 bytes .../main/assets/interfaces/large_buffs.png | Bin 3519 -> 3581 bytes .../assets/messages/actors/actors.properties | 4 + .../shatteredpixeldungeon/Badges.java | 4 + .../actors/buffs/AllyBuff.java | 26 ++- .../actors/buffs/MonkEnergy.java | 171 ++++++++++++++++++ .../actors/hero/HeroClass.java | 2 +- .../actors/mobs/Mob.java | 6 + .../ui/BuffIndicator.java | 1 + 9 files changed, 204 insertions(+), 10 deletions(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MonkEnergy.java diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 221feb02191f678943d96e3e3c8c63120a767926..5ad7e65cde81c63dcc69ca407b1009c9e9031f76 100644 GIT binary patch delta 1303 zcmV+y1?c+C4BrfpBmo_cXxLPh8#zeM*$#z;7LS5RCobokX2#@F$@D20##|5 z8Sa0^Dt7se=~I(LpTtU%Bq_%zR&k0~jPj)53u6rMth^|%%9~=8cO_HuJc^34EQ=tJ z8AE|85rMj{DbN6DtZTczYn>l>25&L|nFx#{1*T~Z`8A6I%d!N4bzMbZ`x4lLz!3z_ z>$=W=9|7h^MN}4XY>bf~s8R|bU@WZVxQ@x4^K!gl7)PJa#ykNqtVe-u+eF~rDR4+J zKlG148A-=R1=6abfq@oaIj#>lFDD2f69IrfFfsmvvohdK(~(vnD-kJ-0eCmul$0zDqV zkJ!iu5IA~z#3Sf-Q31aHx7ddsR@DFn4mScnv4M6?1BT6f$D86^z9;~wflA=$=qXxw zpn*68oPerL{mHyzX*39VV{ajoQbhG5C%Lq7nMNLAqm2tQ{V*|9KSq2 zK7R>;q9`EnswiGT;6+%^o)8L5g22V-0s^mbe_ls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e24MUVgqxePXMwI zC~vU=3B(4LNVQg*#i~6DbQ%r5ls|*~H5ee@VPLb)4x+#>t|Q>*$L=*i1I_^RV*~vB z6d;^|ci0km)uk2BH8AG=#{HGr%FpFoev9e*g>65%kRf z&!8P=V2$)|;^2KsJ+i;{4Wrs*iQ3llCTgo$57LAWT0rf}gg zD8(*_Adn=9dnqfmuzd_)L}L)xPC;UX@BU0+2VaOg6j+h~%jDNR9yq@1d)VRWCxQJS zU>>j_kXj0XgTsS^qaa|!e{tL`9QRnR_(L%_mcjrPK+GV>Y{N=I857}=5CwFY{Jy7v z@9yoo>+x4${_zO}WUqV3{46aMPR~wHC17EdS{V3NDOW7=m5y$2!=TrI(;#d(O#DM8 zY>C(}jui!bZ|{6>&mVua)NCTZ>1G;zHwz84*ucfbV@A5g@-68aO>YlR#oncs&DZK!2v{J~absK&KvOKssnh0w_TF zY9I?UaBy%a0Z*{{Zo%j%X21hVf5R$&`NI*b9KtMo1U=Iig2nYxW2nYxSdaj*SeDfWv00000NkvXXu0mjf-dj4u diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index bdfd5ebf9292a6a50ba392a3624e8d66ed4e8e11..402cd6278dd0f836d67a9ed9640cc35c5d78a92e 100644 GIT binary patch delta 3318 zcmXw+dpJ~!8phXJvlcUEFm8<^CYL6STa?R27P(GtNiIn<)wYuqMbT~6LQ%U!v6cIz zUDOs*C$`kAHbqo)Qk$K!5~17`GYoT_^E~JK=lkB@AK#zv^S)x81)VG-s!D)QkUIbX zcTK4vmYA4`wWd!mNiZSMZ!3U)>G}l#7)9Q0EbnU*PGTc}|w}WbML8*7<{0qL#)1Ws#HXj(%Et!+HFR$FILF2e- z*90yDHWK^7dHovsu@T<4dI@wncQ3}E&)T?0tm++DF+4lJU~8D3ddZZm`@#W>@{Xj8 z?Meh?Vdi)@!f3QqNu>*3K?Y%4iS_N%LDO7ca6*Gsy&fJZfC!EYAbF?776_lty6LEo0y?3lPHsQJ?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K`1Qmrmj@76Z>)olZbQb2 zxOe`+peq!)EOkFvA=hA$-ZGx$iN?filXp{1{)ogHdb=u)*Z%hS? zTJE#L_}}BEc}FuEA{0#Wt zQiinC=3J|#|1%@qz8n`$D<`>mAhs=PYCh-b(EhCInlSYHJZa%ujn_yqs*wNV=_Vtc zeq?!vFZe}#GrfG~n>B4bnb#M<|609sA{k3Tn?nam;LFp{fgBxUm zdgifDmi$H4#gq%=e+IVTc@ZPZQkg#wk2FK}+7hGX4+;v{Si}nXj1u%d|NN0N5KabN zdQZxmIt+n!=tgldx}*;?*W9ZPK`AmG$s3sIh58oWMG3;MD_v5k&NN~VD}c#t)%4KS z*hLt0*%{h3SYt&bI@DeS##WEJ2t!DBTS;?`Gm7zi(f1x-rPcch!7psOO7< zp`m^KfdU<2&-2?my3{~hq2redZ)x<5TmvC#FkFxcFzuQaKPDb+lWXuTz%chz_Yi^M zHaey9ufk$TxL!BpB{p73NrtZ`;2Acy%lGrlS4LRCS1G(=>PHs;KUasYIz zHd&o%6$;$_&ey!e%Z53Giphi$iZP$9nouWZ}U}4-uq?Wb8?8;w2al0W$m+wpmJtwNa9N|cuH&w@A3*#)2 zTAMugqd65FSEh)-vEuD&0ZaSip30d(sv^z|S-AXo*uJO6kY8cQDR4#>e)e^~*ow#; z!`|6sz8?#6M-~>05-V;aduCmp7e=f%Ig7rn`wWKaMhQ~Nn_pbu&_Syc79*8FkANL# zO8n~5Q6~|9>9tq=c{MUQit2)QtUut511yG_=wa(m_WvT$8kgHhs`uXgFY)&D^Qd;? GXZ!~WnUrh* diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 8b5295fd1..9ba875e11 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -270,6 +270,10 @@ actors.buffs.momentum.momentum_desc=As he moves, the Freerunner builds momentum, actors.buffs.momentum.running_desc=As he moves, the Freerunner builds momentum, which he can spend to start freerunning.\n\nWhile freerunning, the Freerunner moves at double speed and gains bonus evasion based on his level.\n\nTurns remaining: %d. actors.buffs.momentum.resting_desc=As he moves, the Freerunner builds momentum, which he can spend to start freerunning.\n\nThe Freerunner needs time to regain his stamina before building momentum again.\n\nTurns remaining: %d. +actors.buffs.monkenergy.name=energy +actors.buffs.monkenergy.desc=As she defeats enemies, the monk gains energy that she can use on a variety of abilities. Most enemies grant 1 energy when defeated, and the Monk does not lose energy over time.\n\nCurrent energy: %1$d/%2$d. +actors.buffs.monkenergy.desc_cooldown=The monk has recently used an ability, and must wait before using another.\n\nCurrent cooldown: %d turns. + actors.buffs.ooze.name=caustic ooze actors.buffs.ooze.heromsg=Caustic ooze eats your flesh. Wash it away! actors.buffs.ooze.ondeath=You melt away... diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java index 5ab86814f..a7cb3efad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java @@ -165,6 +165,8 @@ public class Badges { BOSS_SLAIN_3_ASSASSIN, BOSS_SLAIN_3_SNIPER, BOSS_SLAIN_3_WARDEN, + BOSS_SLAIN_3_CHAMPION, + BOSS_SLAIN_3_MONK, BOSS_SLAIN_3_ALL_SUBCLASSES ( 105, true ), BOSS_CHALLENGE_3 ( 106 ), BOSS_CHALLENGE_4 ( 107 ), @@ -727,6 +729,8 @@ public class Badges { thirdBossSubclassBadges.put(HeroSubClass.FREERUNNER, Badge.BOSS_SLAIN_3_FREERUNNER); thirdBossSubclassBadges.put(HeroSubClass.SNIPER, Badge.BOSS_SLAIN_3_SNIPER); thirdBossSubclassBadges.put(HeroSubClass.WARDEN, Badge.BOSS_SLAIN_3_WARDEN); + thirdBossSubclassBadges.put(HeroSubClass.CHAMPION, Badge.BOSS_SLAIN_3_CHAMPION); + thirdBossSubclassBadges.put(HeroSubClass.MONK, Badge.BOSS_SLAIN_3_MONK); } public static void validateBossSlain() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AllyBuff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AllyBuff.java index c81984c43..a6620f1b5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AllyBuff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AllyBuff.java @@ -22,9 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -49,21 +51,27 @@ public abstract class AllyBuff extends Buff{ //for when applying an ally buff should also cause that enemy to give exp/loot as if they had died //consider that chars with the ally alignment do not drop items or award exp on death public static void affectAndLoot(Mob enemy, Hero hero, Class buffCls){ - boolean droppingLoot = enemy.alignment != Char.Alignment.ALLY; + boolean wasEnemy = enemy.alignment == Char.Alignment.ENEMY; Buff.affect(enemy, buffCls); - if (enemy.buff(buffCls) != null){ - if (droppingLoot) enemy.rollToDropLoot(); + if (enemy.buff(buffCls) != null && wasEnemy){ + enemy.rollToDropLoot(); + Statistics.enemiesSlain++; Badges.validateMonstersSlain(); Statistics.qualifiedForNoKilling = false; - if (enemy.EXP > 0 && hero.lvl <= enemy.maxLvl) { - hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP)); - hero.earnExp(enemy.EXP, enemy.getClass()); - } else { - hero.earnExp(0, enemy.getClass()); + + AscensionChallenge.processEnemyKill(enemy); + + int exp = hero.lvl <= enemy.maxLvl ? enemy.EXP : 0; + if (exp > 0) { + hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", exp)); + } + hero.earnExp(exp, enemy.getClass()); + + if (hero.subClass == HeroSubClass.MONK){ + Buff.affect(hero, MonkEnergy.class).gainEnergy(enemy); } - if (droppingLoot) AscensionChallenge.processEnemyKill(enemy); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MonkEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MonkEnergy.java new file mode 100644 index 000000000..f7f543554 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/MonkEnergy.java @@ -0,0 +1,171 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2023 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Ghoul; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RipperDemon; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogDzewa; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; +import com.watabou.noosa.Image; +import com.watabou.utils.Bundle; + +public class MonkEnergy extends Buff implements ActionIndicator.Action { + + { + type = buffType.POSITIVE; + revivePersists = true; + } + + public float energy; + public int cooldown; + + @Override + public int icon() { + return BuffIndicator.MONK_ENERGY; + } + + @Override + public void tintIcon(Image icon) { + if (cooldown > 0){ + icon.hardlight(0.33f, 0.33f, 1f); + } else { + icon.resetColor(); + } + } + + @Override + public float iconFadePercent() { + return Math.max(0, (energyCap() - energy)/ energyCap()); + } + + @Override + public String iconTextDisplay() { + return Integer.toString((int)energy); + } + + @Override + public boolean act() { + if (cooldown > 0){ + cooldown--; + if (cooldown == 0 && energy >= 1){ + ActionIndicator.setAction(this); + } + BuffIndicator.refreshHero(); + } + + spend(TICK); + return true; + } + + @Override + public String desc() { + String desc = Messages.get(this, "desc", (int)energy, energyCap()); + if (cooldown > 0){ + desc += "\n\n" + Messages.get(this, "desc_cooldown", cooldown); + } + return desc; + } + + public static String ENERGY = "energy"; + public static String COOLDOWN = "cooldown"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(ENERGY, energy); + bundle.put(COOLDOWN, cooldown); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + energy = bundle.getFloat(ENERGY); + cooldown = bundle.getInt(COOLDOWN); + + if (energy >= 1 && cooldown == 0){ + ActionIndicator.setAction(this); + } + } + + public void gainEnergy(Mob enemy ){ + if (target.buff(LockedFloor.class) != null && !target.buff(LockedFloor.class).regenOn()){ + return; //to prevent farming boss minions + } + + //bosses and minibosses give extra energy, certain enemies give half, otherwise give 1 + if (Char.hasProp(enemy, Char.Property.BOSS)) energy += 5; + else if (Char.hasProp(enemy, Char.Property.MINIBOSS)) energy += 3; + else if (enemy instanceof Ghoul) energy += 0.5f; + else if (enemy instanceof RipperDemon) energy += 0.5f; + else if (enemy instanceof YogDzewa.Larva) energy += 0.5f; + else if (enemy instanceof Wraith) energy += 0.5f; + else energy += 1; + + energy = Math.min(energy, energyCap()); + + if (energy > 0 && cooldown == 0){ + ActionIndicator.setAction(this); + } + } + + //10 at base, 20 at level 30 + public int energyCap(){ + return Math.max(10, 5 + Dungeon.hero.lvl/2); + } + + @Override + public String actionName() { + return "TODO"; + } + + @Override + public Image actionIcon() { + return new HeroIcon(HeroSubClass.MONK); + } + + @Override + public void doAction() { + energy -= 1; + cooldown = 3; + ActionIndicator.clearAction(this); + BuffIndicator.refreshHero(); + //GameScene.show(new WndMonk(this)); + } + + public enum MonkAbility { + FLURRY_OF_BLOWS, //1 + CLEANSE, //Just part of meditate? + DASH, //2 or 3 energy? + UPPERCUT, //2 + FOCUS, //3 + DRAGON_KICK, //5 + MEDITATE //5 + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index 2d137efff..0137e81d8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -79,7 +79,7 @@ public enum HeroClass { MAGE( HeroSubClass.BATTLEMAGE, HeroSubClass.WARLOCK ), ROGUE( HeroSubClass.ASSASSIN, HeroSubClass.FREERUNNER ), HUNTRESS( HeroSubClass.SNIPER, HeroSubClass.WARDEN ), - DUELIST( HeroSubClass.CHAMPION ); + DUELIST( HeroSubClass.CHAMPION, HeroSubClass.MONK ); private HeroSubClass[] subClasses; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index debf9a110..ef21c8c1c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -41,12 +41,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MonkEnergy; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.DirectableAlly; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; @@ -733,6 +735,10 @@ public abstract class Mob extends Char { Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "exp", exp)); } Dungeon.hero.earnExp(exp, getClass()); + + if (Dungeon.hero.subClass == HeroSubClass.MONK){ + Buff.affect(Dungeon.hero, MonkEnergy.class).gainEnergy(this); + } } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 2b20c139a..4beb6265c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -119,6 +119,7 @@ public class BuffIndicator extends Component { public static final int DUEL_BRAWL = 65; public static final int DUEL_XBOW = 66; public static final int CHALLENGE = 67; + public static final int MONK_ENERGY = 68; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;