v0.3.0: structure for battlemage rework (some implementation, no balancing atm)
This commit is contained in:
parent
75f1181d27
commit
2d134123de
|
@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
|
@ -125,6 +126,8 @@ public abstract class Wand extends KindOfWeapon {
|
|||
|
||||
protected abstract void onZap( Ballistica attack );
|
||||
|
||||
public abstract void onHit( MagesStaff staff, Char attacker, Char defender, int damage);
|
||||
|
||||
@Override
|
||||
public boolean collect( Bag container ) {
|
||||
if (super.collect( container )) {
|
||||
|
|
|
@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -54,6 +55,11 @@ public class WandOfAmok extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.purpleLight( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -87,6 +88,11 @@ public class WandOfAvalanche extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.earth( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -50,7 +51,12 @@ public class WandOfBlink extends Wand {
|
|||
appear( Dungeon.hero, bolt.collisionPos );
|
||||
Dungeon.observe();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.whiteLight( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -26,6 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.DeathRay;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Death;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
|
@ -92,7 +94,14 @@ public class WandOfDisintegration extends Wand {
|
|||
ch.sprite.flash();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//less likely Grim proc
|
||||
if (Random.Int(10) == 0)
|
||||
new Death().proc( staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
private int distance() {
|
||||
return level() + 4;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -30,11 +31,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
@ -75,6 +78,13 @@ public class WandOfFirebolt extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//acts like blazing enchantment, package conflict.....
|
||||
new com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Fire()
|
||||
.proc( staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.fire( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
|
@ -96,7 +97,12 @@ public class WandOfFlock extends Wand {
|
|||
} while (dist < n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
protected void fx( int cell, Callback callback ) {
|
||||
MagicMissile.wool( curUser.sprite.parent, curUser.pos, cell, callback );
|
||||
Sample.INSTANCE.play( Assets.SND_ZAP );
|
||||
|
|
|
@ -20,6 +20,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.Camera;
|
||||
|
@ -57,7 +59,13 @@ public class WandOfLightning extends Wand {
|
|||
GLog.n( "You killed yourself with your own Wand of Lightning..." );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//acts like shocking enchantment
|
||||
new Shock().proc(staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
private void hit( Char ch, int damage ) {
|
||||
|
||||
if (damage < 1) {
|
||||
|
@ -96,7 +104,7 @@ public class WandOfLightning extends Wand {
|
|||
points[nPoints++] = Dungeon.hero.pos;
|
||||
|
||||
int cell = bolt.collisionPos;
|
||||
|
||||
|
||||
Char ch = Actor.findChar( cell );
|
||||
if (ch != null) {
|
||||
|
||||
|
|
|
@ -24,8 +24,10 @@ import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
@ -85,7 +87,14 @@ public class WandOfMagicMissile extends Wand {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//regains lvl*5% of total missing charge
|
||||
partialCharge += ((maxCharges - curCharges)/20f)*staff.level;
|
||||
SpellSprite.show(attacker, SpellSprite.CHARGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute( Hero hero, String action ) {
|
||||
if (action.equals( AC_DISENCHANT )) {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -50,6 +51,11 @@ public class WandOfPoison extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.poison( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -30,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class WandOfRegrowth extends Wand {
|
||||
|
||||
|
@ -69,6 +74,21 @@ public class WandOfRegrowth extends Wand {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//like vampiric enchantment, except with herbal healing buff
|
||||
|
||||
int level = Math.max( 0, 0/*staff level*/ );
|
||||
|
||||
// lvl 0 - 33%
|
||||
// lvl 1 - 43%
|
||||
// lvl 2 - 50%
|
||||
int maxValue = damage * (level + 2) / (level + 6);
|
||||
int effValue = Math.min( Random.IntRange(0, maxValue), attacker.HT - attacker.HP );
|
||||
|
||||
Buff.affect(attacker, Sungrass.Health.class).boost( effValue );
|
||||
|
||||
}
|
||||
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.foliage( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
Sample.INSTANCE.play( Assets.SND_ZAP );
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -50,6 +51,11 @@ public class WandOfSlowness extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.slowness( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -130,7 +132,12 @@ public class WandOfTelekinesis extends Wand {
|
|||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
private void transport( Heap heap ) {
|
||||
Item item = heap.pickUp();
|
||||
if (item.doPickUp( curUser )) {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
|
@ -75,6 +76,11 @@ public class WandOfTeleportation extends Wand {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx( Ballistica bolt, Callback callback ) {
|
||||
MagicMissile.coldLight( curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback );
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
|
@ -91,6 +92,13 @@ public class MagesStaff extends MeleeWeapon {
|
|||
super.execute(hero, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void proc(Char attacker, Char defender, int damage) {
|
||||
super.proc(attacker, defender, damage);
|
||||
if (wand != null && Dungeon.hero.subClass == HeroSubClass.BATTLEMAGE)
|
||||
wand.onHit( this, attacker, defender, damage );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean collect( Bag container ) {
|
||||
if (super.collect( container )) {
|
||||
|
|
|
@ -123,6 +123,10 @@ public class Sungrass extends Plant {
|
|||
detach();
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void boost( int amount ){
|
||||
level += amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user