// effect routine

last_letter = numletters - 1;
if (last_letter){
 if (sub_order < 2){
  letter_perc = letter / last_letter;
  if (sub_order == 1) letter_perc = 1 - letter_perc;
 } else if (sub_order < 4){
  my_letter = 2 * letter;
  if (my_letter >= numletters) my_letter = 2 * numletters - my_letter - 2;
  letter_perc = my_letter / last_letter;
  if (sub_order == 3) letter_perc = 1 - letter_perc;
 } else {
  letter_perc = frame / lastsubframe;
 }
 perc = Math.min(1, Math.max(0, 2 * frame / lastsubframe - letter_perc));
} else perc = frame / lastsubframe;
if (reverse_sub_effect == true) perc = 1 - perc;
if (letter % 2) a = - 40 else a = 40;
if (letter % 3) b = - 30 else b = 30;
if (letter % 2) d = - 1 else d = 1;
if (use_alpha) alpha = perc * 100;
angle = 44 / 7 * perc;
rota = Math.sin(angle);
tx = rota * ((__x + a) * perc) * 2;
ty = rota * ((__y + b) * perc) * 2;
tz = rota * ((__y + (a + b / 2)) * perc) * 2;
yrotate = rota * (- 360 * perc * rotations * d);
if (perc > .99) zrotate = 0
else zrotate = rota * (- 360 * perc * rotations * d);








