From 66299c6efe49e0ec177bafe51d319abf4c3eee62 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 5 Jan 2023 13:44:12 -0500 Subject: [PATCH] v2.0.0: added 'stance' abilities for the quarterstaff and scimitar --- core/src/main/assets/interfaces/buffs.png | Bin 1515 -> 1536 bytes .../main/assets/interfaces/large_buffs.png | Bin 3255 -> 3378 bytes .../assets/messages/items/items.properties | 8 ++++ .../actors/hero/Hero.java | 5 +++ .../items/weapon/Weapon.java | 13 +++++- .../items/weapon/melee/Quarterstaff.java | 37 ++++++++++++++++++ .../items/weapon/melee/RoundShield.java | 2 +- .../items/weapon/melee/Scimitar.java | 35 +++++++++++++++++ .../ui/BuffIndicator.java | 4 +- 9 files changed, 101 insertions(+), 3 deletions(-) diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 1457fd801acb77f282ec1427a83d69288e1e93b5..16fdaa823926b0183213152966db9cbed191c90d 100644 GIT binary patch delta 1006 zcmV-DJk88 z0kHj)2}A%T0Dlnd?Hyt5xXkzA@sIe-_E zQG#8O0svlo`2TFHe~;}eco3}s;8_CwZWKTL9Kdrt5T6sEApnNS$30#+{=z5NeEa19 z(*R)D`5*AN1OT)7Z1yq$809!_)NN~}RQ;}6T1h~F2modPq_<)5pJr>}l~4fC9{?mk z0xu>nm;nDlfa$B(01&-c>`=)i0?e;0sWq!*{4UauEZK=&o4pdkX!WxOs=L0|eP)ucSGvgA_wKVA8sKi^pb zn0^Al=g*%3Fr@(S#l8SQ&mPqnUSl)37)1aZ=Kz+DDO(oc)3kpP0PfiEFPFcT-LQ^4 zHF#J70H$#O7^gYLvH(*Z0sI#LdF|v606RK@m%*?AV9=4$pWAT%O9MbL0TR?=0vqrL zz!4S!7=g|p)e)GVyZ@yDra1r>O9=nifsL;!;h1w2&N`Z@*PvSX|2Hy2VBm9s05!o- cbik+s0I#i$abiOT0000007*qoM6N<$fpER^$kS@HwF){~m}tM3}SJjk)M7Zr9!A{of;1 zUC@&Z@#Slp^{tQUzZnYHXI{Vz4HOYy3`ej6ffXLX&)CQZ5cu`&uRMZs85Q93e~SH? z`IR<6fzM_Ft8C!wziGf>GvDy0c#|&*0BRr=`1RMfXd&A`b_O^BX#-yye-!?H28^JA zl9dd6jRk=fEDErK{2KDtAW#5*IRn{SkjrrfI8*=O7RZ1CSP&2z!hgC2Cf3D<*c4l0 zTja%#*cE2Bhg}h|*cVmtk#N9j&O|CuDv}by>lA2^jm>6jv(SRFxvJlul zL<2!U4KN=DdwVsky_vuyj`>nP1p0j#Am3o%P=VEg01R{l{QTJSe+Fp48DM^BfS;cN zgfs94TLNhVm;g2qk7G8#dmD*ciM9$iw>LL40l&6J82Hgvu2|$Ne<~jx!C>Bi(ZFvwtbI?` zT${Mh3@a5lJ-s_Uwb`%Q)hhC<=5+U1qiV3Qb8{yvz=3m!c7y`%U`YZ`XQQkD(y@`B&%fr)Vbv^l2Q&x*a5`9y zz?qH!`E!BU*eM?Zu2wsM00M)6j&wN!AT&UOQfOcUOZgC}VNrk;=nP^Vfm@2e*-QY7 zLx}t^0~@az!UNtTB*zCaaefGw-N0`fs9Zpy{-N)HQ3n73eSd+HR`~*a00000NkvXX Hu0mjf2lBWO diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index ffbac1a5e8503d83848cf67be104416581756667..a0d7ad46f6a9c9b1663064f55c6ee30fd956446d 100644 GIT binary patch delta 3056 zcmXw5X;f3^7X9wcO-LAI3K9lMP?SLws;D4p0;o)t#0i;%C<>^EB9@ulkKlj`g2f6d zLQqsdWu__)xhO@8QLqkZ^_9r{1Wh1Nf`;VL_traW?RECqKhCec&pNlw>do^_O(2y7 z0C=^}+Z6yrhxg-_bu(j~BNZ_zm^fNI!;!&QQV49KW}y)d~&Ujj#yRq?wKCyhkK zfDr@(mI~;+TzvnD5^Q9rs>I7xS6uF(E!o}E&E?MK3uvw#4RFc~5nXRrdW{(| zYL1aPpABdGhlnOe!8Q zL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^p)e7~gm$}Y=>Oh09kjS2$^utT4uAB8| zs+$f^O)-WUS}`03mkqyq*E1(1L}@QP_^k&o3qM(gtrVuHf0E?&=Lp?+!_SR<8zOio zhjRORW9_AJb*ZPG9|PD|2bFz&&13sHqV6aMPv2i6_)Nv(N5#+I<~+@CyGS5W*WgmBuN zptv$%XJlB3j|yl>li5n@Dpkai{#2&K*-)koX_Y&|J5poSwORn%-7N4=1`S4_``t}A zlCLM5oSc+@(imc#M)J4>LyHTyT%k+k@#|I9u9Q6WS*496hS@(O&A=UuByS5vRp)Qd zdM$c@%*a2WWK}@1u6M>Y!o>+q}if^W`DB(EM+ zqXG8IuI(Uc^5JU7v^O zMUA>|CL-7cNXn-ib{gB3Y788Qj#~v`=CBju4Ru5hM>D~o zhO;GArrbKSoq~`2!{_aLM!e6QO>9F>3l@goO3YHZmm)@pJ*qllHrp%dHKLcJyIQCw z?$?2ly+mWF-fU{Tgj(xSVyzXroC6$W&hP0Q$q-{CV`6PL3UNBd;RHF)!wr2Fa(Y2`uc#4!S7~@5~Di&MOxSW?yJ% NqnGcxGEaWm{{Zz80r3C; diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 1e152e81b..61fb71c56 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1615,7 +1615,11 @@ items.weapon.melee.shortsword.desc=A quite short sword, only a few inches longer items.weapon.melee.quarterstaff.name=quarterstaff items.weapon.melee.quarterstaff.stats_desc=This weapon blocks 0-2 damage. +items.weapon.melee.quarterstaff.ability_name=defensive stance +items.weapon.melee.quarterstaff.ability_desc=The duelist can assume a _defensive stance_ with a quarterstaff. This stance doubles her evasion for 6 turns, but costs two charges. items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron. +items.weapon.melee.quarterstaff$defensivestance.name=defensive stance +items.weapon.melee.quarterstaff$defensivestance.desc=The Duelist is using her quarterstaff to deflect incoming blows and projectiles. As long as she is in this stance, her evasion against all attacks is doubled.\n\nTurns remaining: %s. items.weapon.melee.rapier.name=rapier items.weapon.melee.rapier.ability_name=lunge @@ -1646,7 +1650,11 @@ items.weapon.melee.sai.desc=Two thin blades meant to be wielded in one hand each items.weapon.melee.scimitar.name=scimitar items.weapon.melee.scimitar.stats_desc=This is a rather fast weapon. +items.weapon.melee.scimitar.ability_name=sword dance +items.weapon.melee.scimitar.ability_desc=The duelist can perform a _sword dance_ with a scimitar. This stance grants the Duelist +60% attack speed and -33% accuracy for 6 turns, and costs two charges. items.weapon.melee.scimitar.desc=A thick curved blade. Its shape allows for faster, yet less powerful attacks. +items.weapon.melee.scimitar$sworddance.name=sword dance +items.weapon.melee.scimitar$sworddance.desc=The Duelist is making quick momentum based strikes with her weapon, in a sort of dance. While this stance is active, she attacks 60%% faster with melee weapons (enough to attack exactly twice a turn with a scimiar), but suffers -33%% accuracy.\n\nTurns remaining: %s. items.weapon.melee.spear.name=spear items.weapon.melee.spear.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index b0f71d5c9..27a611d99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -121,6 +121,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Flail; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Quarterstaff; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RoundShield; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sai; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; @@ -505,6 +506,10 @@ public class Hero extends Char { evasion *= 5f; } } + + if (buff(Quarterstaff.DefensiveStance.class) != null){ + evasion *= 2; + } if (paralysed > 0) { evasion /= 2; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 647031890..294e7d66b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -54,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocki import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Unstable; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RunicBlade; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -184,6 +185,10 @@ abstract public class Weapon extends KindOfWeapon { ACC /= 5; } + if (owner.buff(Scimitar.SwordDance.class) != null){ + ACC *= 0.67f; + } + return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC; } @@ -205,7 +210,13 @@ abstract public class Weapon extends KindOfWeapon { } protected float speedMultiplier(Char owner ){ - return RingOfFuror.attackSpeedMultiplier(owner); + float multi = RingOfFuror.attackSpeedMultiplier(owner); + + if (owner.buff(Scimitar.SwordDance.class) != null){ + multi += 0.6f; + } + + return multi; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java index effd2e06b..f58895efb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java @@ -22,8 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; public class Quarterstaff extends MeleeWeapon { @@ -45,4 +50,36 @@ public class Quarterstaff extends MeleeWeapon { public int defenseFactor( Char owner ) { return 2; //2 extra defence } + + @Override + public float abilityChargeUse(Hero hero) { + return 2; + } + + @Override + protected void duelistAbility(Hero hero, Integer target) { + onAbilityUsed(hero); + Buff.prolong(hero, DefensiveStance.class, 5f); //4 turns as using the ability is instant + hero.sprite.operate(hero.pos); + hero.next(); + } + + public static class DefensiveStance extends FlavourBuff { + + { + announced = true; + type = buffType.POSITIVE; + } + + @Override + public int icon() { + return BuffIndicator.DUEL_EVASIVE; + } + + @Override + public float iconFadePercent() { + return Math.max(0, (6 - visualcooldown()) / 6); + } + } + } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java index 83693f950..4787af541 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java @@ -68,7 +68,7 @@ public class RoundShield extends MeleeWeapon { public static void guardAbility(Hero hero, int duration, MeleeWeapon wep){ wep.onAbilityUsed(hero); - Buff.affect(hero, GuardTracker.class, duration); + Buff.prolong(hero, GuardTracker.class, duration); hero.sprite.operate(hero.pos); hero.spendAndNext(Actor.TICK); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java index fbdfafc4e..1e95f46ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java @@ -22,7 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; public class Scimitar extends MeleeWeapon { @@ -41,4 +45,35 @@ public class Scimitar extends MeleeWeapon { lvl*(tier+1); //scaling unchanged } + @Override + public float abilityChargeUse(Hero hero) { + return 2; + } + + @Override + protected void duelistAbility(Hero hero, Integer target) { + onAbilityUsed(hero); + Buff.prolong(hero, SwordDance.class, 5f); //5 turns as using the ability is instant + hero.sprite.operate(hero.pos); + hero.next(); + } + + public static class SwordDance extends FlavourBuff { + + { + announced = true; + type = buffType.POSITIVE; + } + + @Override + public int icon() { + return BuffIndicator.DUEL_DANCE; + } + + @Override + public float iconFadePercent() { + return Math.max(0, (6 - visualcooldown()) / 6); + } + } + } 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 8295f4f84..930b152d3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -47,7 +47,7 @@ import java.util.LinkedHashMap; public class BuffIndicator extends Component { //transparent icon - public static final int NONE = 63; + public static final int NONE = 127; //FIXME this is becoming a mess, should do a big cleaning pass on all of these //and think about tinting options @@ -114,6 +114,8 @@ public class BuffIndicator extends Component { public static final int DUEL_CLEAVE = 60; public static final int DUEL_GUARD = 61; public static final int DUEL_SPIN = 62; + public static final int DUEL_EVASIVE= 63; + public static final int DUEL_DANCE = 64; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;