v0.2.4: buffed the huntress, improved some logic for thrown weapons

This commit is contained in:
Evan Debenham 2015-02-09 01:05:55 -05:00
parent 071403a7aa
commit db326d87d5
5 changed files with 64 additions and 24 deletions

View File

@ -17,7 +17,7 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
//buff which does not need to act, used as a flag for other logic.
//buff whose only logic is to wait and detach after a time.
public class FlavourBuff extends Buff {
@Override

View File

@ -0,0 +1,43 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.watabou.utils.Bundle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
/**
* Created by debenhame on 06/02/2015.
*/
public class PinCushion extends Buff {
private ArrayList<MissileWeapon> items = new ArrayList<MissileWeapon>();
public void stick(MissileWeapon item){
items.add(item);
}
@Override
public void detach() {
for (Item item : items)
Dungeon.level.drop( item, target.pos).sprite.drop();
super.detach();
}
private static final String ITEMS = "items";
@Override
public void storeInBundle(Bundle bundle) {
bundle.put( ITEMS , items );
super.storeInBundle(bundle);
}
@Override
public void restoreFromBundle(Bundle bundle) {
items = new ArrayList<MissileWeapon>((Collection<MissileWeapon>)((Collection<?>)bundle.getCollection( ITEMS )));
super.restoreFromBundle( bundle );
}
}

View File

@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.TomeOfMastery;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
@ -75,9 +76,11 @@ public enum HeroClass {
public static final String[] HUN_PERKS = {
"Huntresses start with 15 points of Health.",
"Huntresses start with a unique upgradeable boomerang.",
"Huntresses are proficient with missile weapons and get damage bonus for excessive strength when using them.",
"Huntresses are proficient with missile weapons, getting bonus damage from excess strength.",
"Huntresses are able to recover a single used missile weapon from each enemy.",
"Huntresses gain more health from dewdrops.",
"Huntresses sense neighbouring monsters even if they are hidden behind obstacles."
"Huntresses sense neighbouring monsters even if they are hidden behind obstacles.",
"Potions of Mind Vision are identified from the beginning."
};
public void initHero( Hero hero ) {
@ -182,6 +185,8 @@ public enum HeroClass {
boomerang.identify().collect();
Dungeon.quickslot.setSlot(0, boomerang);
new PotionOfMindVision().setKnown();
}
public String title() {

View File

@ -55,24 +55,10 @@ public class IncendiaryDart extends MissileWeapon {
@Override
protected void onThrow( int cell ) {
Char enemy = Actor.findChar( cell );
if (enemy == null || enemy == curUser) {
if (Level.flamable[cell]) {
GameScene.add( Blob.seed( cell, 4, Fire.class ) );
} else {
super.onThrow( cell );
}
} else {
if (!curUser.shoot( enemy, this )) {
Dungeon.level.drop( this, cell ).sprite.drop();
} else {
int bonus = 0;
for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) {
bonus += ((RingOfSharpshooting.Aim)buff).level;
}
if (Random.Float() > Math.pow(0.7, bonus))
Dungeon.level.drop( this, cell ).sprite.drop();
}
}
if ((enemy == null || enemy == curUser) && Level.flamable[cell])
GameScene.add( Blob.seed( cell, 4, Fire.class ) );
else
super.onThrow( cell );
}
@Override

View File

@ -23,6 +23,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -69,11 +70,15 @@ public class MissileWeapon extends Weapon {
miss( cell );
} else if (!(this instanceof Boomerang)){
int bonus = 0;
for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class)) {
for (Buff buff : curUser.buffs(RingOfSharpshooting.Aim.class))
bonus += ((RingOfSharpshooting.Aim)buff).level;
}
if (curUser.heroClass == HeroClass.HUNTRESS && enemy.buff(PinCushion.class) == null)
bonus += 4;
if (Random.Float() > Math.pow(0.7, bonus))
Dungeon.level.drop( this, cell ).sprite.drop();
Buff.affect(enemy, PinCushion.class).stick(this);
}
}
}
@ -84,6 +89,7 @@ public class MissileWeapon extends Weapon {
bonus += ((RingOfSharpshooting.Aim)buff).level;
}
//degraded ring of sharpshooting will even make missed shots break.
if (Random.Float() < Math.pow(0.6, -bonus))
super.onThrow( cell );
}