v1.2.0: implemented buffs to summon elemental

This commit is contained in:
Evan Debenham 2022-03-14 23:42:53 -04:00
parent 6b7a012414
commit 6083465b8e
3 changed files with 46 additions and 14 deletions

View File

@ -1103,8 +1103,8 @@ items.spells.summonelemental.name=summon elemental
items.spells.summonelemental.ac_imbue=IMBUE items.spells.summonelemental.ac_imbue=IMBUE
items.spells.summonelemental.summon_limit=You can only have one elemental summoned at a time. items.spells.summonelemental.summon_limit=You can only have one elemental summoned at a time.
items.spells.summonelemental.imbue_prompt=Imbue an item items.spells.summonelemental.imbue_prompt=Imbue an item
items.spells.summonelemental.desc=This spell channels the energy of the elemental embers used to make it, and will allow you to summon a friendly elemental to fight with you! Only one elemental can be summoned at a time. items.spells.summonelemental.desc=This spell channels the energy of the elemental embers used to make it, and will allow you to summon a friendly elemental to fight with you! Only one elemental can be summoned at a time, but the spell can be re-cast to return the elemental to you at no cost.
items.spells.summonelemental.desc_newborn=The spell is currently unimbued, and will summon a weaker _newborn elemental_. You can imbue an identified potion of liquid flame, potion of frost, scroll of recharging, or scroll of transmutation to power the spell up, causing its next summon to be a full power elemental! items.spells.summonelemental.desc_newborn=The spell is currently unimbued, and will summon a _newborn elemental_. You can imbue an identified potion of liquid flame, potion of frost, scroll of recharging, or scroll of transmutation to power the spell up, causing its next summon to be a full power elemental!
items.spells.summonelemental.desc_fire=The spell is currently hot to the touch, its next summon will be a _fire elemental_. You can imbue a different item, but the spell will lose its current imbue. items.spells.summonelemental.desc_fire=The spell is currently hot to the touch, its next summon will be a _fire elemental_. You can imbue a different item, but the spell will lose its current imbue.
items.spells.summonelemental.desc_frost=The spell is currently cold to the touch, its next summon will be a _frost elemental_. You can imbue a different item, but the spell will lose its current imbue. items.spells.summonelemental.desc_frost=The spell is currently cold to the touch, its next summon will be a _frost elemental_. You can imbue a different item, but the spell will lose its current imbue.
items.spells.summonelemental.desc_shock=The spell is currently radiating static energy, its next summon will be a _shock elemental_. You can imbue a different item, but the spell will lose its current imbue. items.spells.summonelemental.desc_shock=The spell is currently radiating static energy, its next summon will be a _shock elemental_. You can imbue a different item, but the spell will lose its current imbue.

View File

@ -60,14 +60,34 @@ public abstract class Elemental extends Mob {
flying = true; flying = true;
} }
private boolean summonedALly;
@Override @Override
public int damageRoll() { public int damageRoll() {
return Random.NormalIntRange( 20, 25 ); if (!summonedALly) {
return Random.NormalIntRange(20, 25);
} else {
int regionScale = Math.max(2, (1 + Dungeon.depth/5));
return Random.NormalIntRange(5*regionScale, 5 + 5*regionScale);
}
} }
@Override @Override
public int attackSkill( Char target ) { public int attackSkill( Char target ) {
if (!summonedALly) {
return 25; return 25;
} else {
int regionScale = Math.max(2, (1 + Dungeon.depth/5));
return 5 + 5*regionScale;
}
}
public void setSummonedALly(){
summonedALly = true;
//sewers are prison are equivalent, otherwise scales as normal (2/2/3/4/5)
int regionScale = Math.max(2, (1 + Dungeon.depth/5));
defenseSkill = 5*regionScale;
HT = 15*regionScale;
} }
@Override @Override
@ -155,11 +175,13 @@ public abstract class Elemental extends Mob {
protected ArrayList<Class<? extends Buff>> harmfulBuffs = new ArrayList<>(); protected ArrayList<Class<? extends Buff>> harmfulBuffs = new ArrayList<>();
private static final String COOLDOWN = "cooldown"; private static final String COOLDOWN = "cooldown";
private static final String SUMMONED_ALLY = "summoned_ally";
@Override @Override
public void storeInBundle( Bundle bundle ) { public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle ); super.storeInBundle( bundle );
bundle.put( COOLDOWN, rangedCooldown ); bundle.put( COOLDOWN, rangedCooldown );
bundle.put( SUMMONED_ALLY, summonedALly);
} }
@Override @Override
@ -168,6 +190,10 @@ public abstract class Elemental extends Mob {
if (bundle.contains( COOLDOWN )){ if (bundle.contains( COOLDOWN )){
rangedCooldown = bundle.getInt( COOLDOWN ); rangedCooldown = bundle.getInt( COOLDOWN );
} }
summonedALly = bundle.getBoolean( SUMMONED_ALLY );
if (summonedALly){
setSummonedALly();
}
} }
public static class FireElemental extends Elemental { public static class FireElemental extends Elemental {
@ -233,10 +259,11 @@ public abstract class Elemental extends Mob {
} }
//not a miniboss, otherwise a newborn elemental //not a miniboss, fully HP, otherwise a newborn elemental
public static class AllyNewBornElemental extends NewbornFireElemental { public static class AllyNewBornElemental extends NewbornFireElemental {
{ {
HP = HT;
properties.remove(Property.MINIBOSS); properties.remove(Property.MINIBOSS);
} }

View File

@ -87,13 +87,6 @@ public class SummonElemental extends Spell {
@Override @Override
protected void onCast(Hero hero) { protected void onCast(Hero hero) {
for (Char ch : Actor.chars()){
if (ch instanceof Elemental && ch.buff(InvisAlly.class) != null){
GLog.w(Messages.get(this, "summon_limit"));
return;
}
}
ArrayList<Integer> spawnPoints = new ArrayList<>(); ArrayList<Integer> spawnPoints = new ArrayList<>();
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
@ -105,10 +98,22 @@ public class SummonElemental extends Spell {
if (!spawnPoints.isEmpty()){ if (!spawnPoints.isEmpty()){
for (Char ch : Actor.chars()){
if (ch instanceof Elemental && ch.buff(InvisAlly.class) != null){
ScrollOfTeleportation.appear( ch, Random.element(spawnPoints) );
((Elemental) ch).state = ((Elemental) ch).HUNTING;
curUser.spendAndNext(Actor.TICK);
return;
}
}
Elemental elemental = Reflection.newInstance(summonClass); Elemental elemental = Reflection.newInstance(summonClass);
GameScene.add( elemental ); GameScene.add( elemental );
Buff.affect(elemental, InvisAlly.class); Buff.affect(elemental, InvisAlly.class);
elemental.setSummonedALly();
elemental.HP = elemental.HT;
ScrollOfTeleportation.appear( elemental, Random.element(spawnPoints) ); ScrollOfTeleportation.appear( elemental, Random.element(spawnPoints) );
curUser.spendAndNext(Actor.TICK);
summonClass = Elemental.AllyNewBornElemental.class; summonClass = Elemental.AllyNewBornElemental.class;
@ -223,10 +228,10 @@ public class SummonElemental extends Spell {
inputs = new Class[]{Embers.class, ArcaneCatalyst.class}; inputs = new Class[]{Embers.class, ArcaneCatalyst.class};
inQuantity = new int[]{1, 1}; inQuantity = new int[]{1, 1};
cost = 8; cost = 6;
output = SummonElemental.class; output = SummonElemental.class;
outQuantity = 3; outQuantity = 5;
} }
} }