From 368ff47b8e6cbced9465071e7ddc6231ae38570d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 28 Aug 2019 21:57:53 -0400 Subject: [PATCH] v0.7.5: added two new enemies to the sewers, lots of polish still needed --- android/src/main/assets/slime.png | Bin 0 -> 3739 bytes android/src/main/assets/snake.png | Bin 0 -> 5704 bytes .../shatteredpixeldungeon/Assets.java | 2 + .../actors/mobs/Bestiary.java | 38 ++++---- .../actors/mobs/Slime.java | 92 ++++++++++++++++++ .../actors/mobs/Snake.java | 52 ++++++++++ .../levels/RegularLevel.java | 4 +- .../sprites/SlimeSprite.java | 52 ++++++++++ .../sprites/SnakeSprite.java | 52 ++++++++++ .../messages/actors/actors.properties | 6 ++ 10 files changed, 278 insertions(+), 20 deletions(-) create mode 100644 android/src/main/assets/slime.png create mode 100644 android/src/main/assets/snake.png create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SnakeSprite.java diff --git a/android/src/main/assets/slime.png b/android/src/main/assets/slime.png new file mode 100644 index 0000000000000000000000000000000000000000..44268548f601063f85d84b0e5bac2b3cb11b431d GIT binary patch literal 3739 zcmV;M4rK9(P)dQ@0+Qek%> zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#tk|e1Sg#YI$bOay>0*=EYFw+fme0`DC(=*y# z(~itkxzqKc5(xKjclPmr{qsKm;8C=gZfT1!0YsH03?^z`%LU(cVE@cx zlV`r!^Wk~t%^GX*Vmz0!i@cw8u`B6XK61wj;Kg!@k_t)HOU32=Bb{aL(F>+I+vJGh$ZCgkCEz-e>r_)w$dpSkzGOst9 z%BDZ`O-^eq)5D-OnIlQ<6V-K_&4ksbW8>UD?k?wo@|A6CQqIL>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Zs3)111#|5UQkvWo_4iYZGPiy2e`>C!;uEk#y@rhScSl0Ti? znc~p`)?JnbmEh<%yNPF;k0SBTZS&cO4<9~!`0(++#6N-`+N&Zod!hgU002ovPDHLk FV1lT#FgO4J literal 0 HcmV?d00001 diff --git a/android/src/main/assets/snake.png b/android/src/main/assets/snake.png new file mode 100644 index 0000000000000000000000000000000000000000..d5287b2464193c184daa2a716a1172287a84b2fa GIT binary patch literal 5704 zcmV-O7Psk%P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#vl3c3|hX1pQECCQ8v>ZM}Rd$f&=TVP6c5ZGZ zH&vOor^h|#96)-%= zFX{JReE+`kqwp?Y|J3&5bNTW4&kM)*I}iGkUzGlb8{~Wa`uoDVz89|lvZJec<=?;N zufOlz`JR8BZnZ%f#@C^~mPkJz!-bnF$>+AgOZnURSwAo1HCg7AmTx|J^E$;!Es|ep z<)*UAD_$<|ryTa!s#oQ`)>Gy4*%Yl-k7Oy*;#FQ%F}X6O%Be0QElK^}OZlv8pY=|e ztb7ZX*22RIxBSOf`fnHfmDhVGQ=?L%nB}Wh?5o!3Ly0mh_b+@Ez0tM$K}lon&Sr|xf;@`!GD_B3wUj1x z(xAo8tF*f5Ku)@L^VwV9UHj41e|!B8T`NDjRzIDJ>-4*8e5x7``aGh9&h+RR9jmR-ag7cD=o&rC zv$R&DbJ4SG6;|}hCVTYemb_9Kw6J-p{gv;4a&tI6dL zefyKH-H^NU>DU(wqo!G4-}QaBwW6BJU1l8#8W}{)jBq^BdtK#HvUhaW>~&Xm(G6Lm zDrY@*)B1Gj(+WQhOOV3Xq8qwdNejKSduJB!k6SXw_F-LR@!i(7l+&HEqxA&CcvpJXTXI;`N^Xg=?$I953 z)~|bI?D6)vo8GPBLsqw`cRU~jAndkw)y7@A@AzD2$!!&w(a&K=bjX&r^MH{Je>OSR znLSXP_okzJ+C5WzR31$~4%_Q(zmYaibBa~3_dSbp5UHzJo0&%TXOge=Vw6oehz78m zQTMVoFw(b1>DO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rat.class, Rat.class, Rat.class)); + //6x rat, 2x snake + return new ArrayList<>(Arrays.asList( + Rat.class, Rat.class, Rat.class, Rat.class, + Snake.class, Snake.class)); case 2: - //3x rat, 3x gnoll - return new ArrayList<>(Arrays.asList(Rat.class, Rat.class, Rat.class, - Gnoll.class, Gnoll.class, Gnoll.class)); - case 3: - //2x rat, 4x gnoll, 1x crab, 1x swarm + //2x rat, 1x snake, 2x gnoll return new ArrayList<>(Arrays.asList(Rat.class, Rat.class, - Gnoll.class, Gnoll.class, Gnoll.class, Gnoll.class, - Crab.class, Swarm.class)); - case 4: case 5: - //1x rat, 2x gnoll, 3x crab, 1x swarm + Snake.class, + Gnoll.class, Gnoll.class)); + case 3: + //1x rat, 1x snake, 3x gnoll, 1x swarm, 1x crab return new ArrayList<>(Arrays.asList(Rat.class, - Gnoll.class, Gnoll.class, - Crab.class, Crab.class, Crab.class, - Swarm.class)); + Snake.class, + Gnoll.class, Gnoll.class, Gnoll.class, + Swarm.class, + Crab.class)); + case 4: case 5: + //1x gnoll, 1x swarm, 2x crab, 2x slime + return new ArrayList<>(Arrays.asList(Gnoll.class, + Swarm.class, + Crab.class, Crab.class, + Slime.class, Slime.class)); // Prison case 6: @@ -173,8 +176,7 @@ public class Bestiary { default: return; case 4: - if (Random.Float() < 0.01f) rotation.add(Skeleton.class); - if (Random.Float() < 0.01f) rotation.add(Thief.class); + if (Random.Float() < 0.025f) rotation.add(Thief.class); return; // Prison 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 new file mode 100644 index 000000000..5d148792f --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java @@ -0,0 +1,92 @@ +/* + * 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.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; +import com.shatteredpixel.shatteredpixeldungeon.sprites.SlimeSprite; +import com.watabou.utils.Random; + +public class Slime extends Mob { + + { + spriteClass = SlimeSprite.class; + + HP = HT = 25; + defenseSkill = 5; + + EXP = 4; + maxLvl = 9; + + lootChance = 0.1f; + } + + @Override + public int damageRoll() { + return Random.NormalIntRange( 4, 5 ); + } + + @Override + public int attackSkill( Char target ) { + 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); + } + + @Override + public int defenseProc(Char enemy, int damage) { + return super.defenseProc(enemy, Math.min(damage, 6)); + } + + @Override + protected Item createLoot() { + try { + Generator.Category c = Generator.Category.WEP_T2; + MeleeWeapon w = (MeleeWeapon)c.classes[Random.chances(c.probs)].newInstance(); + w.random(); + w.level(0); + return w; + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + return null; + } + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java new file mode 100644 index 000000000..65e9941c5 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java @@ -0,0 +1,52 @@ +/* + * 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.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.sprites.SnakeSprite; +import com.watabou.utils.Random; + +public class Snake extends Mob { + + { + spriteClass = SnakeSprite.class; + + HP = HT = 6; + defenseSkill = 20; + + EXP = 2; + maxLvl = 7; + + //TODO loot? + } + + @Override + public int damageRoll() { + return Random.NormalIntRange( 1, 5 ); + } + + @Override + public int attackSkill( Char target ) { + return 10; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 189072d60..ed2dfb5d5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -180,8 +180,8 @@ public abstract class RegularLevel extends Level { @Override protected void createMobs() { - //on floor 1, 10 rats are created so the player can get level 2. - int mobsToSpawn = Dungeon.depth == 1 ? 10 : nMobs(); + //on floor 1, 8 pre-set mobs are created so the player can get level 2. + int mobsToSpawn = Dungeon.depth == 1 ? 8 : nMobs(); ArrayList stdRooms = new ArrayList<>(); for (Room room : rooms) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java new file mode 100644 index 000000000..93b79136f --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SlimeSprite.java @@ -0,0 +1,52 @@ +/* + * 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; + +//TODO currently just a recolor of goo +public class SlimeSprite extends MobSprite { + + public SlimeSprite() { + super(); + + texture( Assets.SLIME ); + + TextureFilm frames = new TextureFilm( texture, 20, 14 ); + + idle = new Animation( 10, true ); + idle.frames( frames, 2, 1, 0, 0, 1 ); + + run = new Animation( 15, true ); + run.frames( frames, 3, 2, 1, 2 ); + + attack = new Animation( 10, false ); + attack.frames( frames, 8, 9, 10 ); + + die = new Animation( 10, false ); + die.frames( frames, 5, 6, 7 ); + + play(idle); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SnakeSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SnakeSprite.java new file mode 100644 index 000000000..479dcb96a --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/SnakeSprite.java @@ -0,0 +1,52 @@ +/* + * 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; + +//TODO placeholder graphics atm +public class SnakeSprite extends MobSprite { + + public SnakeSprite() { + super(); + + texture( Assets.SNAKE ); + + TextureFilm frames = new TextureFilm( texture, 12, 12 ); + + idle = new Animation( 10, true ); + idle.frames( frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1 ); + + run = new Animation( 10, true ); + run.frames( frames, 3, 4 ); + + attack = new Animation( 15, false ); + attack.frames( frames, 5, 6, 7, 7, 0 ); + + die = new Animation( 10, false ); + die.frames( frames, 8, 9, 10 ); + + 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 bfa085573..256179375 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 @@ -557,6 +557,12 @@ actors.mobs.skeleton.explo_kill=You were killed by the explosion of bones... 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.snake.name=sewer snake +actors.mobs.snake.desc=TODO + actors.mobs.spinner.name=cave spinner actors.mobs.spinner.desc=These greenish furry cave spiders try to avoid direct combat, preferring to wait in the distance while their victim, entangled in the spinner's excreted cobweb, slowly dies from their poisonous bite.