Program: 164271
Project: 164271
Buggy source:
private static void commonEffect(final Wand wand,final Hero user,final Ballistica bolt){
switch (Random.Int(4)) {
case 0:
    cursedFX(user,bolt,new Callback(){
      public void call(){
        Char target=Actor.findChar(bolt.collisionPos);
switch (Random.Int(2)) {
case 0:
          if (target != null)           Buff.affect(target,Burning.class).reignite(target);
        Buff.affect(user,Frost.class,Frost.duration(user) * Random.Float(3f,5f));
      break;
case 1:
    Buff.affect(user,Burning.class).reignite(user);
  if (target != null)   Buff.affect(target,Frost.class,Frost.duration(target) * Random.Float(3f,5f));
break;
}
wand.wandUsed();
}
}
);
break;
case 1:
cursedFX(user,bolt,new Callback(){
public void call(){
int c=Dungeon.level.map[bolt.collisionPos];
if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO || c == Terrain.GRASS || c == Terrain.HIGH_GRASS) {
GameScene.add(Blob.seed(bolt.collisionPos,30,Regrowth.class));
}
wand.wandUsed();
}
}
);
break;
case 2:
switch (Random.Int(2)) {
case 0:
ScrollOfTeleportation.teleportHero(user);
wand.wandUsed();
break;
case 1:
cursedFX(user,bolt,new Callback(){
public void call(){
Char ch=Actor.findChar(bolt.collisionPos);
if (ch != null) {
int count=10;
int pos;
do {
pos=Dungeon.level.randomRespawnCell();
if (count-- <= 0) {
break;
}
}
 while (pos == -1);
if (pos == -1) {
GLog.w(ScrollOfTeleportation.TXT_NO_TELEPORT);
}
 else {
ch.pos=pos;
ch.sprite.place(ch.pos);
ch.sprite.visible=Dungeon.visible[pos];
}
}
wand.wandUsed();
}
}
);
break;
}
break;
case 3:
cursedFX(user,bolt,new Callback(){
public void call(){
switch (Random.Int(3)) {
case 0:
GameScene.add(Blob.seed(bolt.collisionPos,800,ConfusionGas.class));
break;
case 1:
GameScene.add(Blob.seed(bolt.collisionPos,500,ToxicGas.class));
break;
case 2:
GameScene.add(Blob.seed(bolt.collisionPos,200,ParalyticGas.class));
break;
}
wand.wandUsed();
}
}
);
break;
}
}

Fixed version (ground truth):
private static void commonEffect(final Wand wand,final Hero user,final Ballistica bolt){
switch (Random.Int(4)) {
case 0:
    cursedFX(user,bolt,new Callback(){
      public void call(){
        Char target=Actor.findChar(bolt.collisionPos);
switch (Random.Int(2)) {
case 0:
          if (target != null)           Buff.affect(target,Burning.class).reignite(target);
        Buff.affect(user,Frost.class,Frost.duration(user) * Random.Float(3f,5f));
      break;
case 1:
    Buff.affect(user,Burning.class).reignite(user);
  if (target != null)   Buff.affect(target,Frost.class,Frost.duration(target) * Random.Float(3f,5f));
break;
}
wand.wandUsed();
}
}
);
break;
case 1:
cursedFX(user,bolt,new Callback(){
public void call(){
int c=Dungeon.level.map[bolt.collisionPos];
if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO || c == Terrain.GRASS || c == Terrain.HIGH_GRASS) {
GameScene.add(Blob.seed(bolt.collisionPos,30,Regrowth.class));
}
wand.wandUsed();
}
}
);
break;
case 2:
switch (Random.Int(2)) {
case 0:
ScrollOfTeleportation.teleportHero(user);
wand.wandUsed();
break;
case 1:
cursedFX(user,bolt,new Callback(){
public void call(){
Char ch=Actor.findChar(bolt.collisionPos);
if (ch != null) {
int count=10;
int pos;
do {
pos=Dungeon.level.randomRespawnCell();
if (count-- <= 0) {
break;
}
}
 while (pos == -1);
if (pos == -1 || Dungeon.bossLevel()) {
GLog.w(ScrollOfTeleportation.TXT_NO_TELEPORT);
}
 else {
ch.pos=pos;
ch.sprite.place(ch.pos);
ch.sprite.visible=Dungeon.visible[pos];
}
}
wand.wandUsed();
}
}
);
break;
}
break;
case 3:
cursedFX(user,bolt,new Callback(){
public void call(){
switch (Random.Int(3)) {
case 0:
GameScene.add(Blob.seed(bolt.collisionPos,800,ConfusionGas.class));
break;
case 1:
GameScene.add(Blob.seed(bolt.collisionPos,500,ToxicGas.class));
break;
case 2:
GameScene.add(Blob.seed(bolt.collisionPos,200,ParalyticGas.class));
break;
}
wand.wandUsed();
}
}
);
break;
}
}