From 1ba139e8458cde2aef71224201c597ad30d84a0a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 4 Sep 2019 23:28:53 -0400 Subject: [PATCH] v0.7.5: polish work on slimes, including new exotic variant --- android/src/main/assets/slime.png | Bin 3739 -> 367 bytes .../actors/mobs/CausticSlime.java | 61 ++++++++++++++++++ .../actors/mobs/Slime.java | 11 ---- .../sprites/CausticSlimeSprite.java | 53 +++++++++++++++ .../sprites/SlimeSprite.java | 15 ++--- .../messages/actors/actors.properties | 5 +- 6 files changed, 125 insertions(+), 20 deletions(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CausticSlimeSprite.java diff --git a/android/src/main/assets/slime.png b/android/src/main/assets/slime.png index 44268548f601063f85d84b0e5bac2b3cb11b431d..38f2adf48a448e09905a85e6f0385edf951d8837 100644 GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^4M42G!VDxecyh&nlxToYh%1l=$^2(%_z$EQ)YQ}( z8XDB@OI-kR*h+%@f*JnL{Qv)&TH6I*1_nlEPZ!6K3dTJXdNWxR1zJUQ9JVv7%jQT4 z6j&ErI=Jk=(5JMS)e162$0t=c$TRPe=lQ=T;?v#+-&bp2X~a*u9~14BXc~9(_3G3O zDGn}1s|6btEPZh&VWo?UDRV%e*nH3BZ-iSSp6^iY(zMRl__(V4!r|vKR`b~!>=?8k zx5^aOg{$eT{@ZMBcvZ4dYZ?2F^L%9@!FrPqwNI(qEne_qN9f!y?zd-WSHE9#Z1wYs ztvq4|E3=YKnFO|o%w^YU_E?d|p!MsK@yjd4O+v3_wyT($vg=+?e9u|+V~+Fl%M2IT z6H<3w5IT4NU`y)O`VR}287c?d{lf75=E1(atlFR-(n1ofi-FdQ@0+Qek%> zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#tk|e1Sg#YI$bOay>0*=EYFw+fme0`DC(=*y# z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zd)`JCxrcOxHpVSlikO&QlEK^LmnVMNe0II^lem%zbupP4i#BP~&*a`L)>5iO=@Kft zUI%MC-zZ(La~+N_)Oz)!YR}@ZSUTcwjr)lATC6qhqxE!^dJH;ww8bxua3ZIo+&SL? z5W#Kd8=zZuoy3Wplg6}3s0wCQ;PKqqBZyuY7t>*8(et^!f3!PyX z_RC%Tp#@K$CvAJue;Zs3)111#|5UQkvWo_4iYZGPiy2e`>C!;uEk#y@rhScSl0Ti? znc~p`)?JnbmEh<%yNPF;k0SBTZS&cO4<9~!`0(++#6N-`+N&Zod!hgU002ovPDHLk FV1lT#FgO4J diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java new file mode 100644 index 000000000..0af58c263 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java @@ -0,0 +1,61 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2019 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.mobs; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze; +import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CausticSlimeSprite; +import com.watabou.utils.PathFinder; +import com.watabou.utils.Random; + +public class CausticSlime extends Slime { + + { + spriteClass = CausticSlimeSprite.class; + } + + @Override + public int attackProc( Char enemy, int damage ) { + if (Random.Int( 2 ) == 0) { + Buff.affect( enemy, Ooze.class ).set( 20f ); + enemy.sprite.burst( 0x000000, 5 ); + } + + return super.attackProc( enemy, damage ); + } + + @Override + public void rollToDropLoot() { + if (Dungeon.hero.lvl > maxLvl + 2) return; + + super.rollToDropLoot(); + + int ofs; + do { + ofs = PathFinder.NEIGHBOURS8[Random.Int(8)]; + } while (!Dungeon.level.passable[pos + ofs]); + Dungeon.level.drop( new GooBlob(), pos + ofs ).sprite.drop( pos ); + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java index 5d148792f..b857794bf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java @@ -55,17 +55,6 @@ public class Slime extends Mob { return 12; } - @Override - public boolean act() { - - if (Dungeon.level.water[pos] && HP < HT) { - sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - HP++; - } - - return super.act(); - } - @Override public void damage(int dmg, Object src) { super.damage(Math.min(dmg, 6), src); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CausticSlimeSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CausticSlimeSprite.java new file mode 100644 index 000000000..163c85773 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CausticSlimeSprite.java @@ -0,0 +1,53 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2019 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.sprites; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.watabou.noosa.TextureFilm; + +public class CausticSlimeSprite extends MobSprite { + + public CausticSlimeSprite() { + super(); + + texture( Assets.SLIME ); + + TextureFilm frames = new TextureFilm( texture, 14, 12 ); + + int c = 9; + + idle = new Animation( 3, true ); + idle.frames( frames, c+0, c+1, c+1, c+0 ); + + run = new Animation( 10, true ); + run.frames( frames, c+0, c+2, c+3, c+3, c+2, c+0 ); + + attack = new Animation( 10, false ); + attack.frames( frames, c+2, c+3, c+4, c+5, c+2 ); + + die = new Animation( 10, false ); + die.frames( frames, c+0, c+5, c+6, c+7 ); + + play(idle); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java index 93b79136f..c99e6166f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.sprites; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.watabou.noosa.TextureFilm; -//TODO currently just a recolor of goo public class SlimeSprite extends MobSprite { public SlimeSprite() { @@ -32,19 +31,19 @@ public class SlimeSprite extends MobSprite { texture( Assets.SLIME ); - TextureFilm frames = new TextureFilm( texture, 20, 14 ); + TextureFilm frames = new TextureFilm( texture, 14, 12 ); - idle = new Animation( 10, true ); - idle.frames( frames, 2, 1, 0, 0, 1 ); + idle = new Animation( 3, true ); + idle.frames( frames, 0, 1, 1, 0 ); - run = new Animation( 15, true ); - run.frames( frames, 3, 2, 1, 2 ); + run = new Animation( 10, true ); + run.frames( frames, 0, 2, 3, 3, 2, 0 ); attack = new Animation( 10, false ); - attack.frames( frames, 8, 9, 10 ); + attack.frames( frames, 2, 3, 4, 5, 2 ); die = new Animation( 10, false ); - die.frames( frames, 5, 6, 7 ); + die.frames( frames, 0, 5, 6, 7 ); play(idle); } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index 8c21c18d3..e97de89eb 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -448,6 +448,9 @@ actors.mobs.brute.name=gnoll brute actors.mobs.brute.enraged=enraged actors.mobs.brute.desc=Brutes are the largest, strongest and toughest of all gnolls. When severely wounded, they go berserk, inflicting even more damage to their enemies. +actors.mobs.causticslime.name=caustic slime +actors.mobs.causticslime.desc=This slime seems to have been tainted by the dark magic emanating from below. It has lost its usual green color, and drips with caustic ooze. + actors.mobs.crab.name=sewer crab actors.mobs.crab.def_verb=parried actors.mobs.crab.desc=These huge crabs are at the top of the food chain in the sewers. They are extremely fast and their thick carapace can withstand heavy blows. @@ -558,7 +561,7 @@ actors.mobs.skeleton.def_verb=blocked actors.mobs.skeleton.desc=Skeletons are composed of corpses bones from unlucky adventurers and inhabitants of the dungeon, animated by emanations of evil magic from the depths below. After they have been damaged enough, they disintegrate in an explosion of bones. actors.mobs.slime.name=slime -actors.mobs.slime.desc=TODO +actors.mobs.slime.desc=Slimes are strange, slightly magical creatures with a rubbery outer body and a liquid core. The city sewers provide them with an ample supply of water and nutrients.\n\nBecause of their elastic outer membrane, slimes will not take more than _6 damage_ from any one attack. actors.mobs.snake.name=sewer snake actors.mobs.snake.desc=These oversized serpents are capable of quickly slithering around blows, making them quite hard to hit. Magical attacks or surprise attacks are capable of catching them off-guard however.\n\nYou can perform a surprise attack by attacking while out of the snake's vision. One way is to let a snake chase you through a doorway and then _strike just as it moves into the door._