From 161851aa64104209dbc2c9b740c561c32f93ed66 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 30 Apr 2021 23:15:42 -0400 Subject: [PATCH] v0.9.3: implemented the redesigned smoke bomb ability --- .../assets/messages/actors/actors.properties | 12 +- core/src/main/assets/sprites/ninja_log.png | Bin 0 -> 452 bytes .../actors/hero/Talent.java | 2 +- .../hero/abilities/rogue/SmokeBomb.java | 114 ++++++++++++++++-- 4 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 core/src/main/assets/sprites/ninja_log.png diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 0cbc4a95f..f684b0226 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -595,12 +595,12 @@ actors.hero.talent.projectile_momentum.desc=_+1:_ While freerunning, the Freerun actors.hero.talent.speedy_stealth.title=speedy stealth actors.hero.talent.speedy_stealth.desc=_+1:_ The Freerunner gains 2 stacks of momentum per turn while he is invisible.\n\n_+2:_ In addition to the benefits of +1, freerunning no longer counts down while the Freerunner is invisible.\n\n_+3:_ In addition to the benefits of +1 and +2, the Freerunner moves at 2x speed while invisible, regardless of whether he is freerunning or not. -actors.hero.talent.smoke_bomb_1.title=TODO NAME -actors.hero.talent.smoke_bomb_1.desc=TODO DESC -actors.hero.talent.smoke_bomb_2.title=TODO NAME -actors.hero.talent.smoke_bomb_2.desc=TODO DESC -actors.hero.talent.smoke_bomb_3.title=TODO NAME -actors.hero.talent.smoke_bomb_3.desc=TODO DESC +actors.hero.talent.hasty_retreat.title=hasty retreat +actors.hero.talent.hasty_retreat.desc=_+1:_ After blinking the Rogue gains _2 turns_ of haste and invisibility.\n\n_+2:_ After blinking the Rogue gains _4 turns_ of haste and invisibility.\n\n_+3:_ After blinking the Rogue gains _6 turns_ of haste and invisibility.\n\n_+4:_ After blinking the Rogue gains _8 turns_ of haste and invisibility. +actors.hero.talent.body_replacement.title=body replacement +actors.hero.talent.body_replacement.desc=_+1:_ After blinking, the Rogue leaves a wooden decoy behind that has _30 health and 1-5 armor_.\n\n_+2:_ After blinking, the Rogue leaves a wooden decoy behind that has _60 health and 2-10 armor_.\n\n_+3:_ After blinking, the Rogue leaves a wooden decoy behind that has _90 health and 3-15 armor_.\n\n_+4:_ After blinking, the Rogue leaves a wooden decoy behind that has _120 health and 4-20 armor_.\n\nOnly one decoy can be active at a time. +actors.hero.talent.shadow_step.title=shadow step +actors.hero.talent.shadow_step.desc=_+1:_ If the rogue uses smoke bomb while invisible, it occurs instantly and has a _24% reduced_ charge cost, but it also doesn't blind enemies or trigger other talents.\n\n_+2:_ If the rogue uses smoke bomb while invisible, it occurs instantly and has a _42% reduced_ charge cost, but it also doesn't blind enemies or trigger other talents.\n\n_+3:_ If the rogue uses smoke bomb while invisible, it occurs instantly and has a _56% reduced_ charge cost, but it also doesn't blind enemies or trigger other talents.\n\n_+4:_ If the rogue uses smoke bomb while invisible, it occurs instantly and has a _67% reduced_ charge cost, but it also doesn't blind enemies or trigger other talents. actors.hero.talent.smoke_bomb_4.title=TODO NAME actors.hero.talent.smoke_bomb_4.desc=TODO DESC diff --git a/core/src/main/assets/sprites/ninja_log.png b/core/src/main/assets/sprites/ninja_log.png new file mode 100644 index 0000000000000000000000000000000000000000..4f7ca25f017bf5658ecc4183ac197fca83d21f0b GIT binary patch literal 452 zcmV;#0XzPQP)HSRv=O}7$q1OFCro_BqUcl9c)GraYr6|RUcS89w-|dFe4*bJRg|| zT(baZegG;o02FfzNN8wi92^`~RaJa^d@dm&Dk>^sMJPNxJl59MiDNAQ0047IAb?sV zD;^$OJ|Q?OD=|c)g8%>k0d!JMQvg8b*k%9#0R2fsK~#7FjLwB|#83=HQJI--(K7a5 zV&n}eoHt-RcRqYr5Jqv5X0R^J;h%G=D66_@A2Mm$?tk8^erU#NTwzq(-TW`_6f8K| z%!O5DekO+JF*AHWuhv_fZR@ET^PtCIUuSC-BQ?py-!{ u=)~8%YdP=LkK69IuPwW^7Ca3BMgag2#vj})^_HUm0000 0 && hero.hasTalent(Talent.SHADOW_STEP); + + if (!shadowStepping) { + for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { + if (Dungeon.level.adjacent(mob.pos, hero.pos) && mob.alignment != Char.Alignment.ALLY) { + Buff.prolong(mob, Blindness.class, Blindness.DURATION / 2f); + if (mob.state == mob.HUNTING) mob.state = mob.WANDERING; + mob.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 4); + } + } + + if (hero.hasTalent(Talent.BODY_REPLACEMENT)) { + for (Char ch : Actor.chars()){ + if (ch instanceof NinjaLog){ + ch.die(null); + } + } + + NinjaLog n = new NinjaLog(); + n.pos = hero.pos; + GameScene.add(n); + } + + if (hero.hasTalent(Talent.HASTY_RETREAT)){ + int duration = 2*hero.pointsInTalent(Talent.HASTY_RETREAT); + Buff.affect(hero, Haste.class, duration); + Buff.affect(hero, Invisibility.class, duration); } } - Buff.affect(hero, Invisibility.class, Invisibility.DURATION/2f); CellEmitter.get( hero.pos ).burst( Speck.factory( Speck.WOOL ), 10 ); ScrollOfTeleportation.appear( hero, target ); @@ -84,12 +120,72 @@ public class SmokeBomb extends ArmorAbility { Dungeon.observe(); GameScene.updateFog(); - hero.spendAndNext( Actor.TICK ); + if (!shadowStepping) { + hero.spendAndNext(Actor.TICK); + } else { + hero.next(); + } } } @Override public Talent[] talents() { - return new Talent[]{Talent.SMOKE_BOMB_1, Talent.SMOKE_BOMB_2, Talent.SMOKE_BOMB_3, Talent.SMOKE_BOMB_4}; + return new Talent[]{Talent.HASTY_RETREAT, Talent.BODY_REPLACEMENT, Talent.SHADOW_STEP, Talent.SMOKE_BOMB_4}; + } + + public static class NinjaLog extends NPC { + + { + spriteClass = NinjaLogSprite.class; + defenseSkill = 0; + + properties.add(Property.INORGANIC); //wood is organic, but this is accurate for game logic + + alignment = Alignment.ALLY; + + HP = HT = 30*Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT); + } + + @Override + public int drRoll() { + return Random.NormalIntRange(Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT), + 5*Dungeon.hero.pointsInTalent(Talent.BODY_REPLACEMENT)); + } + + } + + public static class NinjaLogSprite extends MobSprite { + + public NinjaLogSprite(){ + super(); + + texture("sprites/ninja_log.png"); + + TextureFilm frames = new TextureFilm( texture, 11, 12 ); + + idle = new Animation( 0, true ); + idle.frames( frames, 0 ); + + run = idle.clone(); + attack = idle.clone(); + zap = attack.clone(); + + die = new Animation( 12, false ); + die.frames( frames, 1, 2, 3, 4 ); + + play( idle ); + + } + + @Override + public void showAlert() { + //do nothing + } + + @Override + public int blood() { + return 0xFF966400; + } + } }