====== Wand Of Regrowth Item - Code References ======
===== Java Classes =====
* ''com/watabou/pixeldungeon/items/wands/WandOfRegrowth.java'' - Main wand implementation
* Extends: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/wands/SimpleWand.java|SimpleWand]]
* Registered in: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/items/common/ItemFactory.java|ItemFactory.java]]
===== Java Class Content =====
package com.watabou.pixeldungeon.items.wands;
import com.nyrds.pixeldungeon.ml.R;
import com.nyrds.platform.audio.Sample;
import com.nyrds.platform.util.StringsManager;
import com.watabou.pixeldungeon.Assets;
import com.watabou.pixeldungeon.Dungeon;
import com.watabou.pixeldungeon.actors.Char;
import com.watabou.pixeldungeon.actors.blobs.Blob;
import com.watabou.pixeldungeon.actors.blobs.Regrowth;
import com.watabou.pixeldungeon.effects.MagicMissile;
import com.watabou.pixeldungeon.levels.Level;
import com.watabou.pixeldungeon.levels.Terrain;
import com.watabou.pixeldungeon.mechanics.Ballistica;
import com.watabou.pixeldungeon.scenes.GameScene;
import com.watabou.pixeldungeon.utils.GLog;
import com.watabou.utils.Callback;
public class WandOfRegrowth extends SimpleWand {
@Override
protected void onZap( int cell, Char ch ) {
final Level level = Dungeon.level;
for (int i = 1; i < Ballistica.distance-1; i++) {
int p = Ballistica.trace[i];
int c = level.map[p];
if (c == Terrain.EMPTY ||
c == Terrain.EMBERS ||
c == Terrain.EMPTY_DECO) {
level.set( p, Terrain.GRASS );
}
}
int c = level.map[cell];
if (c == Terrain.EMPTY ||
c == Terrain.EMBERS ||
c == Terrain.EMPTY_DECO ||
c == Terrain.GRASS ||
c == Terrain.HIGH_GRASS) {
GameScene.add( Blob.seed( cell, (effectiveLevel() + 2) * 20, Regrowth.class ) );
} else {
GLog.i(StringsManager.getVar(R.string.WandOfRegrowth_Info1));
}
}
protected void fx( int cell, Callback callback ) {
MagicMissile.foliage( getOwner().getSprite().getParent(), getOwner().getPos(), cell, callback );
Sample.INSTANCE.play( Assets.SND_ZAP );
}
@Override
public String desc() {
return StringsManager.getVar(R.string.WandOfRegrowth_Info);
}
}
===== Key Mechanics =====
* **Terrain Conversion:** Converts EMPTY, EMBERS, and EMPTY_DECO terrain to GRASS
* **Regrowth Blob:** Seeds regrowth blob with power = (effectiveLevel() + 2) * 20
* **Visual Effect:** Uses MagicMissile.foliage() for zap animation
* **Sound:** Plays Assets.SND_ZAP on zap
===== JSON Configuration =====
No dedicated JSON configuration file found. Wand is implemented entirely in Java.
===== String Resources =====
English (''values/strings_all.xml''):
Wand of Regrowth
"When life ceases new life always begins to grow... The eternal cycle always remains!"
nothing happened
Russian (''values-ru/strings_all.xml''):
Посох роста
"Когда жизнь прекращается, новая жизнь всегда начинает расти... Вечный цикл всегда остается!"
ничего не произошло
===== Lua Scripts =====
No Lua script implementation. This wand is implemented entirely in Java.
===== Related Effects =====
* [[mr:regrowth_blob|Regrowth Blob]] - The blob effect created by this wand
* [[mr:roots_buff|Roots Buff]] - Movement impairment effect from regrowth
* [[mr:grass_terrain|Grass Terrain]] - Terrain created by this wand
===== See Also =====
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/wands/SimpleWand.java|SimpleWand Base Class]]
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/blobs/Regrowth.java|Regrowth Blob]]
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/effects/MagicMissile.java|MagicMissile Effects]]
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/mechanics/Ballistica.java|Ballistica]]