v3.0.0: Implemented Trinity mind form for thrown weapons
This commit is contained in:
@@ -100,7 +100,9 @@ public class MindForm extends ClericSpell {
|
||||
private MissileWeapon thrown(){
|
||||
if (effect instanceof MissileWeapon){
|
||||
((MissileWeapon) effect).level(effectLevel());
|
||||
((MissileWeapon) effect).repair(100);
|
||||
((MissileWeapon) effect).identify(false);
|
||||
((MissileWeapon) effect).spawnedForEffect = true;
|
||||
return (MissileWeapon) effect;
|
||||
}
|
||||
return null;
|
||||
@@ -151,7 +153,9 @@ public class MindForm extends ClericSpell {
|
||||
});
|
||||
}
|
||||
} else if (thrown() != null){
|
||||
//TODO
|
||||
MissileWeapon thrown = thrown();
|
||||
thrown.cast(Dungeon.hero, target);
|
||||
((ClassArmor)Dungeon.hero.belongings.armor()).charge -= Trinity.trinityChargeUsePerEffect(thrown.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,11 +126,13 @@ public class HeavyBoomerang extends MissileWeapon {
|
||||
@Override
|
||||
public void call() {
|
||||
if (returnTarget == target){
|
||||
if (target instanceof Hero && boomerang.doPickUp((Hero) target)) {
|
||||
//grabbing the boomerang takes no time
|
||||
((Hero) target).spend(-TIME_TO_PICK_UP);
|
||||
} else {
|
||||
Dungeon.level.drop(boomerang, returnPos).sprite.drop();
|
||||
if (!boomerang.spawnedForEffect) {
|
||||
if (target instanceof Hero && boomerang.doPickUp((Hero) target)) {
|
||||
//grabbing the boomerang takes no time
|
||||
((Hero) target).spend(-TIME_TO_PICK_UP);
|
||||
} else {
|
||||
Dungeon.level.drop(boomerang, returnPos).sprite.drop();
|
||||
}
|
||||
}
|
||||
|
||||
} else if (returnTarget != null){
|
||||
@@ -138,11 +140,11 @@ public class HeavyBoomerang extends MissileWeapon {
|
||||
if (((Hero)target).shoot( returnTarget, boomerang )) {
|
||||
boomerang.decrementDurability();
|
||||
}
|
||||
if (boomerang.durability > 0) {
|
||||
if (!boomerang.spawnedForEffect && boomerang.durability > 0) {
|
||||
Dungeon.level.drop(boomerang, returnPos).sprite.drop();
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (!boomerang.spawnedForEffect) {
|
||||
Dungeon.level.drop(boomerang, returnPos).sprite.drop();
|
||||
}
|
||||
CircleBack.this.next();
|
||||
|
||||
@@ -59,6 +59,9 @@ abstract public class MissileWeapon extends Weapon {
|
||||
defaultAction = AC_THROW;
|
||||
usesTargeting = true;
|
||||
}
|
||||
|
||||
//whether or not this instance of the item exists purely to trigger its effect. i.e. no dropping
|
||||
public boolean spawnedForEffect = false;
|
||||
|
||||
protected boolean sticky = true;
|
||||
|
||||
@@ -241,7 +244,7 @@ abstract public class MissileWeapon extends Weapon {
|
||||
}
|
||||
}
|
||||
|
||||
super.onThrow( cell );
|
||||
if (!spawnedForEffect) super.onThrow( cell );
|
||||
} else {
|
||||
if (!curUser.shoot( enemy, this )) {
|
||||
rangedMiss( cell );
|
||||
@@ -307,13 +310,13 @@ abstract public class MissileWeapon extends Weapon {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Dungeon.level.drop( this, cell ).sprite.drop();
|
||||
if (!spawnedForEffect) Dungeon.level.drop( this, cell ).sprite.drop();
|
||||
}
|
||||
}
|
||||
|
||||
protected void rangedMiss( int cell ) {
|
||||
parent = null;
|
||||
super.onThrow(cell);
|
||||
if (!spawnedForEffect) super.onThrow(cell);
|
||||
}
|
||||
|
||||
public float durabilityLeft(){
|
||||
@@ -500,12 +503,14 @@ abstract public class MissileWeapon extends Weapon {
|
||||
public int value() {
|
||||
return 6 * tier * quantity * (level() + 1);
|
||||
}
|
||||
|
||||
|
||||
private static final String SPAWNED = "spawned";
|
||||
private static final String DURABILITY = "durability";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(SPAWNED, spawnedForEffect);
|
||||
bundle.put(DURABILITY, durability);
|
||||
}
|
||||
|
||||
@@ -516,6 +521,7 @@ abstract public class MissileWeapon extends Weapon {
|
||||
bundleRestoring = true;
|
||||
super.restoreFromBundle(bundle);
|
||||
bundleRestoring = false;
|
||||
spawnedForEffect = bundle.getBoolean(SPAWNED);
|
||||
durability = bundle.getFloat(DURABILITY);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class IncendiaryDart extends TippedDart {
|
||||
if ((enemy == null || enemy == curUser) && Dungeon.level.flamable[cell]) {
|
||||
GameScene.add(Blob.seed(cell, 4, Fire.class));
|
||||
decrementDurability();
|
||||
if (durability > 0){
|
||||
if (durability > 0 || spawnedForEffect){
|
||||
super.onThrow(cell);
|
||||
} else {
|
||||
Dungeon.level.drop(new Dart(), cell).sprite.drop();
|
||||
|
||||
@@ -130,7 +130,7 @@ public abstract class TippedDart extends Dart {
|
||||
super.rangedHit( enemy, cell);
|
||||
|
||||
//need to spawn a dart
|
||||
if (durability <= 0){
|
||||
if (durability <= 0 && !spawnedForEffect){
|
||||
//attempt to stick the dart to the enemy, just drop it if we can't.
|
||||
Dart d = new Dart();
|
||||
Catalog.countUse(getClass());
|
||||
|
||||
Reference in New Issue
Block a user