From 33b015a25e629b04c0cf42b40b5b7336c090c328 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 3 Sep 2014 14:39:15 -0400 Subject: [PATCH] V0.2.0: Added Cape of Thorns --- assets/buffs.png | Bin 4201 -> 4239 bytes assets/large_buffs.png | Bin 5724 -> 5779 bytes .../items/artifacts/CapeOfThorns.java | 113 ++++++++++++++++++ .../ui/BuffIndicator.java | 1 + 4 files changed, 114 insertions(+) create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java diff --git a/assets/buffs.png b/assets/buffs.png index e809c1aa349600692391e753f7df3c9f219d7b4e..b4f605681b57d4a4b1e6950383d2919c4d9e6685 100644 GIT binary patch delta 1537 zcmV+c2LAc!AdexiX$lVpVoOIv0RI600RN!9r<0Rr3Lh*90}>wyCuZx?000HoNkli@c&~4N?Oio4VJ?|(etGls;qH2U-oHUQ)pQCb^LU; zJmxF6{y1zVqn&;;IqrF6Cgt~w&7@TFx|xLf15%i->&A_e1VDCJToX(`X2H%;Eq?pE zADGF1=H@TWs#F0bsbafR6aEw)&-XlD}pDc&g}rtDP1< zHnjAMA16Y0emc@cXCib5Pqeh^^4!ewywhD*AB;?&?z);;p2sopl)#w_0PZp2j*{;& z)(ll%y(%w?00I@9L%z%2d8ZAOdk?pRB@H?;J3 zcdRAF=}$!!3kVS7bUKr~5r79H({)Xy03M7?1E^~%CBWvtmm+p0Hn9jC`A$xM{pJ=+ zU$b&~&C2B>NJSdYsh6F$`PNOp*v9G4(o2y@!q|vOPu5yE-x5>vv1mal5}(z77j@@I zP~uZ55Fp0y_a}KH07E19CchVSO3_#s3^9)e8 z$7<#5H}TtJ__sY8bBuddEaDl^vtp6O$cgh8ssggZ@PC~o`d{(HPK%m+Ikf=*Gv}%% zx)dXXlj;7#$D#+|+U*s;sOO8uc*_oiwJN*#S4B|}4l9b{^BG^g;_>vp`vJncva2qn z=cW4nt1HUHk7q;iAE@MiM|^i}m}Q&8vrD(x2qZPrr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Q=DW7GP8JQ{We~04n(6 zdYvPPtL7K2OcnVV{NlZ=WSE_ug`S=s=;`V40jG|s$^h<%OA4@?mJHul!@7XVL71le zx;1Z~{|v_Nd_o(U_@3A#g_^Eq8xjE@W9~b-u z8bGN{1$KXWnWp?t68x#rF~~GFXvIJVzij^ETb*$5^>a$V@%TzP36Nz3Dv>bvk8j}o zhgXzv<7nS;co&p!dAcMue?bPIs^xDCOi1ssvAtDQRnXhp3%$L)eriu0WA#1zFZ)?? z_{T}h#=V$M0dyi?kN_A|+f&yR8-7ZZr(_2duyucHg3kSA^G-JFU)fBCtNT^Yc#o|y zu*5dks$QFQ{E^o--Rs!l*^&5t_)G2r59 zfNDSH00OM_7- zAfG02>woaVKDq4j`Lnoq#Oji0svl=B0KUhU zN)L$AFxVJ)onxSaZW8$yKzF!{asmJVKKx+?KwU2YwNF3>x@;_J6V-iD1CXuJflf*N zWto7iwmrvJaRE!272DmB{pd9}(&{e?eP6^JwIq1W$ z68M7B{$j!}6#*IG#cl<5=I2T0`^D%2#7-a#{5JJI13XMCFhI2D{-*8Gw&pc#)Rt}m z)T2NKI#c;6QC|c+Y%4GWTqgns)%?ZG0@jow(kn}V2;sIp=f_SU?!JH9NRRDaUu)6& z{#9lZ=^5nM5yagCU>fO790Ape9r*(tz^au7{8cL*^xsGOKMlyT2M_FBw*UYD07*qo IM6N<$f*Ixcwg3PC diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java new file mode 100644 index 000000000..37ec1dfde --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -0,0 +1,113 @@ +package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; +import com.watabou.utils.Random; + +/** + * Created by debenhame on 03/09/2014. + */ +public class CapeOfThorns extends Artifact { + //TODO: add polish, testing + + { + name = "Cape of Thorns"; + image = ItemSpriteSheet.ARTIFACT_CAPE; + level = 0; + levelCap = 10; + charge = 0; + chargeCap = 100; + //partialcharge is unused + } + + private int timer = 0; + + private int exp = 0; + + @Override + public String status() { + if (timer == 0) + return Utils.format("%d%", charge); + else + return Utils.format("%d", timer); + } + + @Override + protected ArtifactBuff passiveBuff() { + return new Thorns(); + } + + @Override + public String desc() { + //TODO: add description + return ""; + } + + public class Thorns extends ArtifactBuff{ + + @Override + public boolean act(){ + if (timer > 0) + timer--; + else if (charge > 0) + charge--; + return true; + } + + public int proc(int damage, Char attacker){ + if (timer == 0){ + charge += damage/(4f - level*0.1); + if (charge > chargeCap){ + charge = 0; + timer = 5+level; + } + } + + if (timer != 0){ + int deflected = Random.NormalIntRange(0, (int)(damage*0.66)); + damage -= deflected; + + attacker.damage(deflected, this); + + exp+= deflected; + + if (exp >= (level+1)*10 && level < levelCap){ + exp -= (level+1)*10; + level++; + GLog.p("Your Cape grows stronger!"); + } + + } + return damage; + } + + @Override + public String toString() { + return "Thorns"; + } + + @Override + public int icon() { + if (timer == 0) + return BuffIndicator.NONE; + else + return BuffIndicator.THORNS; + } + + @Override + public void detach(){ + timer = 0; + charge = 0; + } + + } + + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 2e26e817d..adb11e43c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -64,6 +64,7 @@ public class BuffIndicator extends Component { public static final int DEFERRED = 28; public static final int DROWSY = 29; public static final int MAGIC_SLEEP = 30; + public static final int THORNS = 31; public static final int SIZE = 7;