v0.6.1: reworked base mechanics of the dried rose
This commit is contained in:
parent
8c50b988a3
commit
80414bd6fd
|
@ -38,7 +38,9 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
@ -203,10 +205,17 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
|
spend( TICK );
|
||||||
|
|
||||||
|
//rose does not charge while ghost hero is alive
|
||||||
|
if (spawned){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
|
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
|
||||||
partialCharge += 1/4f; //400 turns to a full charge
|
partialCharge += 1/5f; //500 turns to a full charge
|
||||||
if (partialCharge > 1){
|
if (partialCharge > 1){
|
||||||
charge++;
|
charge++;
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
|
@ -235,8 +244,6 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
|
|
||||||
spend( TICK );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,6 +295,12 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
ally = true;
|
ally = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO currently there is no way to assign these
|
||||||
|
private MeleeWeapon weapon = null;
|
||||||
|
private Armor armor = null;
|
||||||
|
|
||||||
|
private DriedRose rose;
|
||||||
|
|
||||||
public GhostHero() {
|
public GhostHero() {
|
||||||
super();
|
super();
|
||||||
|
@ -298,7 +311,7 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
public GhostHero(int roseLevel){
|
public GhostHero(int roseLevel){
|
||||||
this();
|
this();
|
||||||
HP = HT = 10+roseLevel*4;
|
HP = HT = 20+roseLevel*4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saySpawned(){
|
public void saySpawned(){
|
||||||
|
@ -335,7 +348,13 @@ public class DriedRose extends Artifact {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
if (Random.Int(10) == 0) damage(1 , this);
|
if (rose == null) {
|
||||||
|
rose = Dungeon.hero.belongings.getItem(DriedRose.class);
|
||||||
|
}
|
||||||
|
if (rose == null || !rose.isEquipped(Dungeon.hero)){
|
||||||
|
damage(1, this);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAlive())
|
if (!isAlive())
|
||||||
return true;
|
return true;
|
||||||
if (!Dungeon.hero.isAlive()){
|
if (!Dungeon.hero.isAlive()){
|
||||||
|
@ -374,17 +393,50 @@ public class DriedRose extends Artifact {
|
||||||
//same accuracy as the hero.
|
//same accuracy as the hero.
|
||||||
return (defenseSkill/2)+5;
|
return (defenseSkill/2)+5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FIXME currently many effects on weapons/armor are ignored
|
||||||
|
//probably should refactor weapons/armor to not be so locked to hero
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float attackDelay() {
|
||||||
|
if (weapon != null){
|
||||||
|
return weapon.DLY;
|
||||||
|
} else {
|
||||||
|
return super.attackDelay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canAttack(Char enemy) {
|
||||||
|
if (weapon != null) {
|
||||||
|
return Dungeon.level.distance(pos, enemy.pos) <= weapon.RCH;
|
||||||
|
} else {
|
||||||
|
return super.canAttack(enemy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll() {
|
public int damageRoll() {
|
||||||
int lvl = (HT-10)/4;
|
int dmg = 0;
|
||||||
return Random.NormalIntRange( 3+lvl/2, 8+lvl);
|
if (weapon != null){
|
||||||
|
dmg += Random.NormalIntRange(weapon.min(), weapon.max());
|
||||||
|
} else {
|
||||||
|
dmg += Random.NormalIntRange(0, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int drRoll() {
|
public int drRoll() {
|
||||||
int lvl = (HT-10)/4;
|
int block = 0;
|
||||||
return Random.NormalIntRange(0, 2+lvl);
|
if (armor != null){
|
||||||
|
block += Random.NormalIntRange( armor.DRMin(), armor.DRMax());
|
||||||
|
}
|
||||||
|
if (weapon != null){
|
||||||
|
block += Random.NormalIntRange( 0, weapon.defenseFactor( null ));
|
||||||
|
}
|
||||||
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -201,7 +201,7 @@ public abstract class Level implements Bundlable {
|
||||||
|
|
||||||
DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
|
DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
|
||||||
if (rose != null && !rose.cursed){
|
if (rose != null && !rose.cursed){
|
||||||
//this way if a rose is dropped later in the game, player still has a chance to max it out.
|
//aim to drop 1 petal every 2 floors
|
||||||
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
|
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
|
||||||
|
|
||||||
for (int i=1; i <= petalsNeeded; i++) {
|
for (int i=1; i <= petalsNeeded; i++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user