Frame 2
function startup() {
if (a) {
return(undefined);
}
a = true;
b = new c("Puyo");
b.d();
}
function g() {
var _local2 = this;
var h = createEmptyMovieClip("sprite_root", 0);
var i = 500;
var j = new Array(i);
var _local1 = 0;
while (_local1 < i) {
j[_local1] = i - _local1;
_local1++;
}
var l = new Object();
_local2.m = function () {
return(j.length);
};
_local2.n = function (o) {
var _local1 = o;
var _local3 = this;
var p = (j.pop() + i);
var q = ("sprite" + p);
var _local2;
if ((typeof(_local1.s) == "string") && (l[_local1.s])) {
l[_local1.s].createEmptyMovieClip(q, p);
_local2 = l[_local1.s][q];
} else {
h.createEmptyMovieClip(q, p);
_local2 = h[q];
}
if (typeof(_local1.t) == "string") {
_local2.attachMovie(_local1.t, "member_mc", p);
}
_local2._x = ((typeof(_local1.u) == "number") ? (_local1.u) : (Stage.width / 2));
_local2._y = ((typeof(_local1.v) == "number") ? (_local1.v) : (Stage.height / 2));
if (typeof(_local1.width) == "number") {
_local2._width = _local1.width;
}
if (typeof(_local1.height) == "number") {
_local2._height = _local1.height;
}
if (typeof(_local1.w) == "number") {
_local2._xscale = _local1.w;
}
if (typeof(_local1.x) == "number") {
_local2._yscale = _local1.x;
}
_local2._visible = ((typeof(_local1.y) == "boolean") ? (_local1.y) : true);
_local2._alpha = ((typeof(_local1.z) == "number") ? (_local1.z) : 100);
_local2.ac = p;
_local2.ad = function () {
var _local1 = this;
var ae = _local1.ac;
var _local2 = _local1.ac % i;
_local1.swapDepths(_local2);
_local1.member_mc.swapDepths(_local2);
_local1.ac = _local2;
};
_local2.ag = function () {
var _local2 = this;
var _local1 = (_local2.ac % i) + (i * 2);
_local2.swapDepths(_local1);
_local2.member_mc.swapDepths(_local1);
_local2.ac = _local1;
};
return(_local2);
};
_local2.ah = function (o) {
var _local2 = o;
if (typeof(_local2.s) == "string") {
var _local1 = _local2.s;
_local2.s = null;
if (l[_local1]) {
aj("Alert! generating an already existing group: ", _local1);
} else {
l[_local1] = this.n(_local2);
l[_local1].ak = _local1;
}
}
return(l[_local1]);
};
_local2.al = function (am) {
var _local1 = am;
if (typeof(_local1) == "string") {
ai = _local1;
} else {
ai = _local1.ak;
}
if (l[ai]) {
f.an(l[ai]);
l[ai] = null;
}
};
_local2.setMember = function (ao, t) {
ao.attachMovie(t, "member_mc", ao.getDepth());
};
_local2.ap = function (o) {
var _local1 = o;
var aq = this.n({u:_local1.u, v:_local1.v});
aq.createTextField("member_mc", aq.ac, 0, 0, 1, 1);
var _local2 = aq.member_mc;
_local2.autosize = ((typeof(_local1.align) == "string") ? (_local1.align) : "left");
_local2.multiline = false;
_local2.wordWrap = false;
_local2.border = false;
_local2.selectable = false;
_local2.type = "dynamic";
_local2.embedFonts = true;
var _local3 = new TextFormat();
_local3.color = ((typeof(_local1.color) == "string") ? (_local1.color) : "0xffffff");
_local3.size = _local1.size || 9;
_local3.font = ((typeof(_local1.font) == "string") ? (_local1.font) : "Arial");
_local3.align = ((typeof(_local1.align) == "string") ? (_local1.align) : "left");
_local3.bold = ((typeof(_local1.bold) == "boolean") ? (_local1.bold) : false);
_local2.setNewTextFormat(_local3);
_local2.text = ((typeof(_local1.text) == "string") ? (_local1.text) : "");
return(aq);
};
_local2.an = function (ao) {
var _local2 = ao;
if (!_local2.ac) {
} else {
var _local1 = _local2.ac % i;
_local2.removeMovieClip();
j.push(_local1);
return(_local1);
}
return(undefined);
};
}
function au() {
var _local3 = this;
var av = new Array();
var aw = 0;
_local3.ax = function (object) {
var _local2 = object;
if (typeof(_local2.ay) == "function") {
var _local1 = 0;
while (_local1 < av.length) {
if (av[_local1] == _local2) {
return;
}
_local1++;
}
_local2.az = false;
av.push(_local2);
} else {
aj("tried to run bad object!");
bc(_local2);
}
};
_local3.bd = function (object) {
var _local2 = object;
var _local1 = 0;
while (_local1 < av.length) {
if (av[_local1] == _local2) {
aw++;
av[_local1].az = true;
return;
}
_local1++;
}
};
onEnterFrame = function () {
var _local2 = av;
var _local1 = 0;
while (_local1 < _local2.length) {
if (!_local2[_local1].az) {
_local2[_local1].ay();
}
_local1++;
}
if (aw > 0) {
_local1 = 0;
while (_local1 < av.length) {
if (av[_local1].az) {
av[_local1].az = false;
av.splice(_local1, 1);
_local1--;
aw--;
}
_local1++;
}
}
};
_local3.bf = function () {
aj("Running Object list:");
var _local1 = 0;
while (_local1 < av.length) {
aj(av[_local1]);
_local1++;
}
};
_local3.bg = function () {
var _local2 = av;
var _local1 = 0;
while (_local1 < _local2.length) {
if (typeof(_local2[_local1]) != "object") {
aj("invalid object in event: ", _local1);
}
_local1++;
}
};
}
function bi() {
var _local2 = ["snd_levelintro.wav", "snd_land.wav", "snd_rotate.wav", "snd_flower_1.wav", "snd_flower_2.wav", "snd_flower_3.wav", "snd_flower_4.wav", "snd_flower_5.wav"];
createEmptyMovieClip("sound_fx", -1);
var bk = 0;
var bl = new Object();
var bm = new Object();
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = new Sound(bo.createEmptyMovieClip("sound_" + (_local1 + 1), (-_local1) - 2));
_local3.attachSound(_local2[_local1]);
_local3.onSoundComplete = function () {
this.bp = false;
};
bl[_local2[_local1]] = _local3;
bl[_local2[_local1]].bp = false;
bl[_local2[_local1]].bq = _local2[_local1];
_local1++;
}
this.play = function (sound, br) {
var _local1 = sound;
if (bl[_local1].bp) {
if (br) {
return;
}
this.stop(_local1);
}
bl[_local1].bp = true;
bl[_local1].start();
};
this.bs = function (sound, bt) {
var _local2 = sound;
var _local1 = bm["ch_" + bt];
if (_local1) {
if (_local1.bp) {
this.stop(_local1.bq);
}
}
bl[_local2].bp = true;
bl[_local2].start();
bm["ch_" + bt] = bl[_local2];
};
this.stop = function (sound) {
bl[sound].stop();
bl[sound].bp = false;
};
}
function c() {
var _local1 = this;
function start() {
b.cc = false;
b.cd = ce(gameData);
bx = new cf();
log = new cg();
b.ch = new ci();
b.ch.cj(b.cd);
fscommand ("gameStart");
b.ck({action:"version", value:bw});
b.cl = new cm();
at.ax(b.cl);
b.cn();
b.co = new cp();
b.co.cq();
by = new String();
by.cr = getTimer();
bz = new String();
bz.cs = getTimer();
bz.ct = 0;
}
var self = _local1;
var bx;
var log;
var by;
var bz;
_local1.d = function () {
var _local1 = new Object();
_local1.ay = function () {
if (gameData != undefined) {
at.bd(this);
b.cb();
}
};
at.ax(_local1);
};
_local1.cb = function () {
start();
};
_local1.cn = function () {
var _local1 = this;
var _local2 = _local1.cl.cu();
_local1.ch.cv(_local2);
_local1.cl.cw = _local1.cd.cl[_local1.cl.cx].required;
_local1.cl.cy(_local1.cd.cl[_local1.cl.cx].flowers);
_local1.cl.cz.da(_local1.cd.cl[_local1.cl.cx].speed);
bh.play("snd_levelintro.wav");
};
_local1.db = function () {
this.cl.dc();
};
_local1.ay = function () {
var _local1 = getTimer();
if (this.cc) {
} else if (bv) {
this.bz(_local1);
}
};
_local1.de = function (dd) {
var _local3 = this;
var _local1 = Math.max(0, Math.round(_local3.cd.duration - ((dd - by.cr) / 1000)));
if (_local1 == 0) {
b.dg(_local3.cd.text.timeup);
}
var _local2 = String(Math.floor(_local1 / 60) + ":");
_local1 = _local1 % 60;
_local2 = _local2 + ((_local1 < 10) ? ("0" + _local1) : (_local1));
if (by.current != _local2) {
_local3.ch.setTime(_local2);
by.current = _local2;
}
};
_local1.bz = function (dd) {
bz.ct++;
if ((dd - bz.cs) > 1000) {
b.ch.di("FPS: " + bz.ct);
bz.cs = dd;
bz.ct = 0;
}
};
_local1.dg = function (dj) {
var _local1 = this;
if (_local1.cc) {
} else {
_local1.ck({action:"total num cleared", value:_local1.cl.dk});
_local1.cc = true;
at.bd(_local1.cl);
at.bd(_local1.cl.cz);
var _local2 = _local1.cl.cx - 1;
if (dj == "all cleared") {
_local2++;
}
fscommand ("gameEnd", String(b.dm()));
_local1.ch.alert(_local1.cd.text.game_over, _local1.cd.text.levels_cleared, _local2, _local1.cd.text.flowers_cleared, _local1.cl.dk, _local1.cd.text.final_score, _local1.dn());
_local1.ch.dp();
}
};
_local1.dn = function () {
return(bx.dn());
};
_local1.dq = function () {
return(bx.dq());
};
_local1.dr = function () {
return(bx.dr());
};
_local1.ds = function () {
return(bx.ds());
};
_local1.ck = function (o) {
log.dt(o);
return(bx.ck(o));
};
_local1.dm = function () {
var _local3 = new cf();
var _local2 = log.dw();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.ck(_local2[_local1]);
_local1++;
}
return(_local3.dn());
};
}
function ce(dy) {
var cd = {};
cd.cl = [];
cd.text = {};
var dz = new XML();
dz.ignoreWhite = true;
dz.parseXML(dy);
var ea = dz.firstChild.attributes;
for (var eb in ea) {
cd[eb] = ea[eb];
}
var _local2 = dz.firstChild.childNodes;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].nodeName == "text") {
cd.text[_local2[_local1].attributes.id] = _local2[_local1].firstChild.nodeValue;
} else if (_local2[_local1].nodeName == "level") {
for (var eb in _local2[_local1].attributes) {
var _local3 = cd.cl[_local2[_local1].attributes.number];
if (!_local3) {
cd.cl[_local2[_local1].attributes.number] = {};
_local3 = cd.cl[_local2[_local1].attributes.number];
}
_local3[eb] = _local2[_local1].attributes[eb];
}
}
_local1++;
}
return(cd);
}
function aj() {
var _local2 = arguments;
var _local3 = "> ";
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + _local2[_local1];
_local1++;
if (_local2.length != _local1) {
_local3 = _local3 + " ";
}
}
trace(_local3);
}
function bc(ef, eg) {
var _local1 = ef;
var _local3 = eg;
function eh(ef, eg, ei) {
var _local1 = ef;
var _local2 = ei;
var _local3 = eg;
_local2 = ((typeof(_local2) == "string") ? (_local2 + ".") : "");
for (eb in _local1) {
trace(((_local2 + eb) + ": ") + _local1[eb]);
if (_local3) {
if (typeof(_local1[eb]) == "object") {
eh(_local1[eb], _local3, _local2 + eb);
}
}
}
}
trace("--- Obj dump: ---------");
eh(_local1, _local3);
trace("-----------------------");
}
function ej(width, ek) {
var _local2 = "";
var _local3 = ((typeof(ek) != "string") ? " " : (ek));
var _local1 = 0;
while (_local1 < width) {
_local2 = _local2 + _local3;
_local1++;
}
return(_local2);
}
function Random() {
var _local1 = this;
var en = 0;
var eo = 0;
_local1.ep = function (start, stop) {
var _local2 = stop - start;
var _local1 = Math.random() * (_local2 + 1);
_local1 = Math.floor(start + _local1);
return(Math.min(_local1, stop));
};
_local1.et = function (bn) {
en = bn & 65535;
eo = en;
};
_local1.eu = function (start, stop) {
var _local2 = stop - start;
var _local1 = this.ev() * (_local2 + 1);
_local1 = Math.floor(start + _local1);
return(Math.min(_local1, stop));
};
_local1.ew = function (start, stop) {
var _local2 = stop - start;
var _local1 = this.ex() * (_local2 + 1);
_local1 = Math.floor(start + _local1);
return(Math.min(_local1, stop));
};
_local1.ev = function () {
en = ((en * 732573) + 3545443) & 65535;
ey = en / 65536;
return(ey);
};
_local1.ex = function () {
eo = ((eo * 732573) + 3545443) & 65535;
ey = eo / 65536;
return(ey);
};
}
function ez(o) {
var _local1 = this;
var _local2 = o;
_local1.fa = _local2.ao;
_local1.fb = ((typeof(_local2.fb) == "string") ? (_local2.fb) : "in");
_local1.fc = _local2.frames || 10;
_local1.fd = _local1.fc;
_local1.fe = 100 / _local1.fc;
if (_local1.fb == "in") {
_local1.fe = -_local1.fe;
_local1.ff = 0;
} else {
_local1.ff = 100;
}
_local1.fg = _local2.fg;
_local1.ay = function () {
var _local1 = this;
_local1.fd--;
_local1.ff = _local1.ff - _local1.fe;
_local1.fa._alpha = _local1.ff;
if (_local1.fd == 0) {
if (_local1.fb == "pulse") {
_local1.fd = _local1.fc;
_local1.fe = -_local1.fe;
} else {
at.bd(_local1);
if (_local1.fg) {
_local1.fg();
}
}
}
};
at.ax(_local1);
}
function fh(o) {
var _local1 = this;
var _local2 = o;
_local1.fa = _local2.ao;
_local1.fg = _local2.fg;
_local1.fi = _local2.fi || 0;
_local1.fj = _local2.fj;
_local1.fk = 0;
_local1.fl = ((typeof(_local2.fl) == "boolean") ? (_local2.fl) : false);
_local1.ay = function () {
var _local1 = this;
if (_local1.fi > 0) {
_local1.fi--;
} else if (_local1.fk > _local1.fj.length) {
if (_local1.fl) {
_local1.fk = 0;
// unexpected jump
}
at.bd(_local1);
if (_local1.fg) {
_local1.fg();
}
} else {
f.setMember(_local1.fa, _local1.fj[_local1.fk]);
_local1.fk++;
}
};
_local1.fm = function () {
at.bd(this);
};
at.ax(_local1);
}
function fn(o) {
var _local1 = this;
_local1.fa = o.ao;
_local1.r = _local1.fa.member_mc;
_local1.r.stop();
_local1.fg = o.fg;
if (o.fo) {
_local1.fo = o.fo;
_local1.fp = o.fo.length - 1;
_local1.fq = 0;
} else {
_local1.fo = false;
_local1.fp = _local1.r._totalframes;
_local1.fq = 1;
}
_local1.fl = (o.fl ? true : false);
_local1.fr = ((typeof(o.fr) == "number") ? (o.fr) : 1);
_local1.fs = _local1.fr;
_local1.ay = function () {
var _local1 = this;
if ((_local1.fs--) == 0) {
_local1.fs = _local1.fr;
if (_local1.fq > _local1.fp) {
if (_local1.fl) {
_local1.fq = (o.fo ? 0 : 1);
// unexpected jump
}
at.bd(_local1);
if (_local1.fg) {
_local1.fg();
}
} else {
if (_local1.fo) {
_local1.r.gotoAndStop(_local1.fo[_local1.fq]);
} else {
_local1.r.gotoAndStop(_local1.fq);
}
_local1.fq++;
}
}
};
_local1.stop = function () {
at.bd(this);
};
at.ax(_local1);
}
function ft(fu, frames) {
var _local1 = this;
_local1.fu = fu;
_local1.fd = 0;
_local1.fc = frames;
_local1.ay = function () {
var _local1 = this;
_local1.fd++;
if (_local1.fd > _local1.fc) {
at.bd(_local1);
_local1.fu();
}
};
at.ax(_local1);
}
function ci() {
var _local1 = this;
function hd(dh) {
return(typeof(dh) == "string");
}
_local1.fv = null;
_local1.fw = false;
var fx = 276;
var fy = 90;
var fz = new gc(_level0.text_1);
at.ax(fz);
_level0.btn_button1.onPress = function () {
b.co.gd("button1");
};
_level0.btn_button1.onRelease = function () {
b.co.gf("button1");
};
_level0.btn_button1.onReleaseOutside = _level0.btn_button1.onRelease;
_level0.btn_button2.onPress = function () {
b.co.gd("button2");
};
_level0.btn_button2.onRelease = function () {
b.co.gf("button2");
};
_level0.btn_button2.onReleaseOutside = _level0.btn_button2.onRelease;
_level0.btn_left.onPress = function () {
b.co.gd("left");
};
_level0.btn_left.onRelease = function () {
b.co.gf("left");
};
_level0.btn_left.onReleaseOutside = _level0.btn_left.onRelease;
_level0.btn_right.onPress = function () {
b.co.gd("right");
};
_level0.btn_right.onRelease = function () {
b.co.gf("right");
};
_level0.btn_right.onReleaseOutside = _level0.btn_right.onRelease;
_level0.btn_down.onPress = function () {
b.co.gd("down");
};
_level0.btn_down.onRelease = function () {
b.co.gf("down");
};
_level0.btn_down.onReleaseOutside = _level0.btn_down.onRelease;
_local1.setTime = function (gg) {
_level0.text_2.text = gg;
};
_local1.gh = function (gi) {
_level0.text_2.text = gi;
};
_local1.gj = function (gk) {
fz.gl(gk);
};
_local1.cv = function (cl) {
var _local1 = this;
var _local2 = cl;
_level0.text_3.text = _local2;
_local1.fv = f.n({u:fx, v:fy, t:"level_0" + _local2});
_local1.fv.member_mc.header_txt.text = b.cd.text[("level_" + _local2) + "_header"];
_local1.fv.member_mc.body_txt.text = b.cd.text[("level_" + _local2) + "_text"];
_local1.fv.swapDepths(3333);
var _local3 = function () {
f.al(this.fa);
b.ch.fv = null;
b.db();
};
_local1.fv.gn = new gp({ao:_local1.fv, v:445, fg:_local3});
};
_local1.dq = function () {
return(b.dq());
};
_local1.di = function (gq) {
_level0.info_text.text = gq;
};
_local1.alert = function (gr, gs, gu, gv, gw, gx, gy) {
var _local1 = this;
if (_local1.fw) {
} else {
_local1.fw = true;
if (_local1.fv) {
at.bd(_local1.fv.gn);
_local1.fv.gn = null;
f.an(_local1.fv);
}
var ao = f.n({t:"popupbox", u:fx, v:fy});
ao.member_mc.header_txt.text = gr;
ao.member_mc.body_txt1.text = gs;
ao.member_mc.body_no1.text = gu;
ao.member_mc.body_txt2.text = gv;
ao.member_mc.body_no2.text = gw;
ao.member_mc.body_txt3.text = gx;
ao.member_mc.body_no3.text = gy;
ao.swapDepths(3333);
var _local2 = function () {
fscommand ("gameQuit");
};
new gp({ao:ao, v:445, fb:"in", fi:b.cd.gz * 25, fg:_local2, ha:true});
}
};
_local1.cj = function (hb) {
var _local1 = hb;
_level0.text_tag_1.text = _local1.text.score;
_level0.text_tag_2.text = _local1.text.flowers_left;
_level0.text_tag_3.text = _local1.text.level;
_level0.end_game_text.text = _local1.text.end_game;
this.di(_local1.text.instruction);
_level0.end_game_button._visible = true;
};
_level0.end_game_button._visible = false;
_level0.end_game_button.onRelease = function () {
b.ck({action:"end button pressed"});
b.dg();
};
_local1.dp = function () {
hc._visible = false;
};
}
function gc(he) {
function hl() {
var _local1 = hi - hh;
var _local2 = _local1 * hg;
if (Math.abs(_local1) <= 2) {
hh = hi;
} else {
hh = hh + _local2;
}
hj.text = Math.round(hh);
if (hi == hh) {
ho();
}
}
function ho() {
hf = false;
}
var hf = false;
var hg = 0.2;
var hh = 0;
var hi = 0;
var hj = he;
this.gl = function (hk) {
hf = true;
if ((hi + hk) < 0) {
hi = 0;
} else {
hi = hi + hk;
}
};
this.ay = function () {
if (hf) {
hl();
}
};
}
function cf() {
var _local2 = this;
var cx = 1;
var hp = false;
var hq = 0;
var hr = {};
hr.version = 112;
hr.drop = 765;
hr["new level"] = 56;
hr["end level"] = 99;
hr["empty squares bonus"] = 899;
hr["empty rows bonus"] = 2001;
hr["flowers cleared"] = 5;
hr.quicksilver = 75;
hr["chain reaction"] = 3453;
hr["end button pressed"] = 843;
hr["total num cleared"] = 798;
var hs = [0, 0, 0, 0, 100, 150, 200, 300, 500, 750, 1000];
var ht = [0, 1, 2, 4, 6, 9, 12];
var hu = 1;
var hv = [1, 1, 1.2, 1.5];
_local2.dq = function () {
return(cx);
};
_local2.dn = function () {
return(hq);
};
_local2.dr = function () {
return(hv[cx]);
};
_local2.ds = function () {
return(hu);
};
_local2.ck = function (hw) {
var _local1 = hw;
var _local2 = 0;
_local1.hx = hr[_local1.action] || -1;
if (_local1.action == "drop") {
hu = 1;
_local1.hx = (_local1.hx + ",") + _local1.value;
_local2 = 2;
} else if (_local1.action == "new level") {
cx = _local1.value;
} else if (_local1.action == "end level") {
} else if (_local1.action == "empty squares bonus") {
_local2 = 10 * _local1.value;
} else if (_local1.action == "empty rows bonus") {
_local2 = 100 * _local1.value;
} else if (_local1.action == "total num cleared") {
_local2 = 0;
} else if (_local1.action == "flowers cleared") {
_local2 = hs[Math.min(_local1.value, 10)];
if (_local1.value > 10) {
_local2 = _local2 + ((_local1.value - 10) * 500);
}
var _local3 = ht[Math.min(hu, 6)];
if (hu > 6) {
_local3 = _local3 + ((hu - 6) * 4);
}
_local2 = _local2 * _local3;
if (!b.cc) {
if (!_local1.hz) {
bh.bs(("snd_flower_" + Math.min(5, hu)) + ".wav", "flower");
}
}
hu++;
} else if (_local1.action == "quicksilver") {
hu++;
} else if (_local1.action == "end button pressed") {
} else if (_local1.action == "version") {
_local2 = 0;
} else {
aj("illegal score event: ", _local1.action);
}
_local2 = Math.round(_local2 * hv[cx]);
var ia = hq;
hq = hq + _local2;
hq = Math.max(0, hq);
if (!b.cc) {
b.ch.gj(_local2);
}
_local1.ib = hq - ia;
this.ic(_local1);
return(_local2);
};
_local2.ic = function (o) {
var _local2 = o;
if (b.cc) {
} else {
var _local1 = String(_local2.hx);
if (_local2.value != undefined) {
_local1 = _local1 + ("," + String(_local2.value));
}
_local1 = _local1 + ("=" + String(_local2.ib));
fscommand ("playData", _local1);
aj("pd: ", _local1);
}
};
}
function cg() {
var id = new Array();
this.dt = function (ie) {
id.push(ie);
};
this.dw = function () {
return(id);
};
}
function ig(u, v, ib, ih, ii, frames) {
var _local1 = this;
var _local3 = v;
_local1.ak = (((("poppy_" + u) + "_") + _local3) + "_") + random.ep(1, 256);
_local1.s = f.ah({u:u, v:_local3, s:_local1.ak});
_local1.s._visible = false;
_local1.s.ag();
_local1.ij = 14;
_local1.ik = 11;
_local1.il = _local1.s._y - (_local1.ij / 2);
_local1.im = _local1.il;
_local1.ih = _local1.il - (ih || 72);
_local1.io = 0;
_local1.fc = frames || 16;
_local1.ip = 1;
_local1.iq = 100;
_local1.ir = ii || 12;
var ib = ib.toString();
var is = ib.length;
var _local2 = 0;
while (_local2 < is) {
f.n({u:_local2 * _local1.ik, v:0, t:"no_" + ib.substr(_local2, 1), s:_local1.ak});
_local2++;
}
_local1.s._x = _local1.s._x - Math.round(_local1.s._width / 2);
_local1.s._y = _local1.im;
_local1.ay = function () {
var _local1 = this;
if (_local1.ip == 1) {
_local1.ir--;
if (_local1.ir == 0) {
_local1.ip++;
_local1.s._visible = true;
}
} else if (_local1.ip == 2) {
_local1.io = Math.min(_local1.io + (Math.PI / (_local1.fc * 2)), (Math.PI/2));
_local1.im = Math.max(0, _local1.il + (Math.sin(_local1.io) * (_local1.ih - _local1.il)));
_local1.s._y = _local1.im;
if (_local1.io >= (Math.PI/2)) {
_local1.ip++;
}
} else if (_local1.ip == 3) {
_local1.iq = _local1.iq - 12;
_local1.s._alpha = _local1.iq;
if (_local1.iq < 10) {
at.bd(_local1);
f.al(_local1.s);
}
}
};
at.ax(_local1);
}
function gp(o) {
var _local1 = this;
var _local2 = o;
_local1.fa = _local2.ao;
_local1.it = _local1.fa._x;
_local1.im = _local1.fa._y;
_local1.iu = ((typeof(_local2.u) == "number") ? (_local2.u) : (_local1.it));
_local1.il = ((typeof(_local2.v) == "number") ? (_local2.v) : (_local1.im));
_local1.iv = _local1.it;
_local1.ih = _local1.im;
_local1.iw = _local1.iu != _local1.iv;
_local1.ix = _local1.il != _local1.ih;
_local1.fa._x = _local1.iu;
_local1.fa._y = _local1.il;
_local1.iy = false;
_local1.fg = _local2.fg;
_local1.ip = 1;
_local1.fi = _local2.fi || 125;
_local1.io = 0;
_local1.fc = _local2.fc || 15;
_local1.fb = ((typeof(_local2.fb) == "string") ? (_local2.fb) : "in out");
if (!_local2.ha) {
_local1.fa.onRelease = function () {
this.iy = true;
};
}
_local1.ay = function () {
var _local1 = this;
switch (_local1.ip) {
case 1 :
if (_local1.iz()) {
_local1.ip++;
_local1.iv = _local1.iu;
_local1.ih = _local1.il;
_local1.iu = _local1.it;
_local1.il = _local1.im;
_local1.iw = _local1.iu != _local1.iv;
_local1.ix = _local1.il != _local1.ih;
_local1.io = 0;
}
return;
case 2 :
if (_local1.fi <= 0) {
if (_local1.fb == "in out") {
_local1.ip++;
} else {
_local1.ja();
return;
}
}
_local1.fi--;
if (_local1.fb == "in out") {
if (_local1.fa.iy) {
_local1.fi = 0;
}
}
return;
case 3 :
if (!_local1.jb()) {
break;
}
_local1.ip++;
_local1.ja();
return;
}
};
_local1.ja = function () {
var _local1 = this;
at.bd(_local1);
if (_local1.fg) {
_local1.fg();
}
};
_local1.iz = function () {
var _local1 = this;
_local1.io = Math.min(_local1.io + (Math.PI / (_local1.fc * 2)), (Math.PI/2));
if (_local1.iw) {
_local1.it = _local1.iu + (Math.sin(_local1.io) * (_local1.iv - _local1.iu));
_local1.fa._x = _local1.it;
}
if (_local1.ix) {
_local1.im = _local1.il + (Math.sin(_local1.io) * (_local1.ih - _local1.il));
_local1.fa._y = _local1.im;
}
if (_local1.io >= (Math.PI/2)) {
return(true);
}
return(false);
};
_local1.jb = function () {
var _local1 = this;
_local1.io = Math.min(_local1.io + (Math.PI / (_local1.fc * 2)), (Math.PI/2));
var _local2 = Math.sin(_local1.io + 4.71238898038469) + 1;
_local2 = _local2 * _local2;
if (_local1.iw) {
_local1.it = _local1.iu + (_local2 * (_local1.iv - _local1.iu));
_local1.fa._x = _local1.it;
}
if (_local1.ix) {
_local1.im = _local1.il + (_local2 * (_local1.ih - _local1.il));
_local1.fa._y = _local1.im;
}
if (_local1.io >= (Math.PI/2)) {
return(true);
}
return(false);
};
at.ax(_local1);
}
function cm() {
var _local1 = this;
function kb(kt) {
var _local1 = kt;
_local1.lf = true;
_local1.lm = false;
var _local3 = _local1.kq;
var _local2 = _local1.kr;
jy[_local3][_local2] = false;
self.lg(_local1);
self.mk(_local1);
if (_local1.kn) {
_local1.kn.stop();
_local1.kn = null;
}
f.an(_local1);
}
function ml(kt) {
var _local1 = kt;
if (_local1.color == "quicksilver") {
var mm = {t:"poisonman", u:_local1._x, v:_local1._y};
var _local2 = {fo:[3, 4, 5], fr:2};
} else if (_local1.color == "stone") {
var mm = {t:"flowerman", u:_local1._x, v:_local1._y};
var _local2 = {fo:[4, 1, 5, 6], fr:1};
} else {
var mm = {t:"xplode", u:_local1._x, v:_local1._y};
var _local2 = {};
}
var _local3 = f.n(mm);
_local3.ad();
_local2.ao = _local3;
_local2.fg = function () {
f.an(this.fa);
};
new fn(_local2);
}
function mr(ms) {
var _local2 = 0;
while (_local2 < jy.length) {
var _local1 = jy[_local2].length - 1;
while (_local1 >= 0) {
if ((jy[_local2][_local1].color == ms) && (!jy[_local2][_local1].lm)) {
aj("xplode same color!", _local2, _local1);
var _local3 = jy[_local2][_local1];
_local3.lm = true;
jt.push(_local3);
ju.push(_local3);
}
_local1--;
}
_local2++;
}
}
function ln(u, v, color) {
var _local3 = v;
var _local1 = jy[u][_local3];
if (((_local1.color != color) || (_local1.lf)) || (_local1.lm)) {
return(0);
}
var _local2 = 1;
_local1.lm = true;
jt.push(_local1);
ju.push(_local1);
_local2 = _local2 + ln(u - 1, _local3, color);
_local2 = _local2 + ln(u + 1, _local3, color);
_local2 = _local2 + ln(u, _local3 - 1, color);
_local2 = _local2 + ln(u, _local3 + 1, color);
return(_local2);
}
function ma() {
var _local3 = ju.length;
var u;
var v;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = ju[_local1];
_local2.mt = 10 + _local1;
_local2.lf = true;
self.kd.push(_local2);
_local1++;
}
}
var self = _local1;
_local1.cx = 0;
_local1.jd = 34;
_local1.je = ["green", "peach", "pink", "purple", "white", "yellow"];
_local1.jf = ["NG", "NO", "NP", "NB", "NW", "NY", 0, 0, 0, 0, "FG", "FO", "FP", "FB", "FW", "FY"];
_local1.jg = "MG";
_local1.jh = "MY";
_local1.ji = "";
_local1.jj = 0;
_local1.jk = 279;
_local1.jl = 9 - (_local1.jd * 2);
_local1.jm = 6;
_local1.jn = 12;
_local1.jo = 0;
_local1.jp = 0;
_local1.cw = 1;
_local1.jq = 2;
_local1.dk = 0;
_local1.jr = 0;
_local1.js = new Array();
var jt = new Array();
var ju = new Array();
var jv = "none";
var jw = 0;
var jx = new Array();
var jy;
_local1.jz = new jz(_local1);
_local1.jz.start();
_local1.ka = function () {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.jm) {
var _local1 = 0;
while (_local1 < (_local3.jn + 1)) {
if (jy[_local2][_local1]) {
kb(jy[_local2][_local1]);
}
_local1++;
}
_local2++;
}
};
_local1.cy = function (kc) {
var _local3 = this;
_local3.ji = kc.split(" ");
_local3.jj = 0;
jy = new Array();
var _local2 = 0;
while (_local2 < _local3.jm) {
jy.push(new Array());
var _local1 = 0;
while (_local1 < (_local3.jn + 1)) {
jy[_local2].push(false);
_local1++;
}
_local2++;
}
_local3.kd = new Array();
_local3.ke = 0;
_local3.jo = 0;
_local3.jp = 0;
_local3.kf = 0;
b.ch.gh(_local3.cw);
_local3.cz = new kg();
_local3.cz.cq(_local3);
_local3.kh();
jv = "none";
jw = 0;
jx = new Array();
};
_local1.ay = function () {
this.ki();
if (jv != "none") {
this.kj();
}
};
_local1.kk = function (u, color, v) {
var _local1 = this;
if (typeof(v) != "number") {
var v = 0;
}
var _local3;
var _local2;
if (color == "quicksilver") {
_local3 = "poisonman";
var o = {t:_local3, u:_local1.jk + (u * _local1.jd), v:_local1.jl + (v * _local1.jd)};
_local2 = f.n(o);
var ek = new fn({ao:_local2, fo:[1, 2, 1, 2, 1, 1, 1, 1, 1], fr:4, fl:true});
_local2.kn = ek;
} else if (color == "stone") {
_local3 = "flowerman";
var o = {t:_local3, u:_local1.jk + (u * _local1.jd), v:_local1.jl + (v * _local1.jd)};
_local2 = f.n(o);
var ek = new fn({ao:_local2, fo:[1, 3, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1], fr:3, fl:true});
_local2.kn = ek;
} else if (color >= 10) {
_local3 = _local1.je[color - 10] + "_anim";
var o = {t:_local3, u:_local1.jk + (u * _local1.jd), v:_local1.jl + (v * _local1.jd)};
_local2 = f.n(o);
_local2.ko = _local1.je[color - 10];
var gm = function () {
var _local1 = this;
b.cl.ke--;
_local1.fa.kp = false;
_local1.fa.color = _local1.fa.color - 10;
_local1.fa.kn.stop();
_local1.fa.kn = null;
f.setMember(_local1.fa, _local1.fa.ko);
_local1.fa.ko = false;
};
var ek = new fn({ao:_local2, fg:gm, fr:2});
ek.stop();
_local2.kn = ek;
} else {
_local3 = _local1.je[color];
var o = {t:_local3, u:_local1.jk + (u * _local1.jd), v:_local1.jl + (v * _local1.jd)};
_local2 = f.n(o);
}
_local2.color = color;
_local2.kq = u;
_local2.kr = v;
jy[u][v] = _local2;
return(_local2);
};
_local1.ks = function (kt, u, v) {
var _local1 = kt;
var _local2 = v;
var _local3 = u;
if (!this.ku(_local3, _local2)) {
return(false);
}
jy[_local3][_local2] = _local1;
jy[_local1.kq][_local1.kr] = false;
_local1.kq = _local3;
_local1.kr = _local2;
return(true);
};
_local1.kv = function (kt, u, v) {
var _local1 = v;
var _local2 = kt;
var _local3 = u;
if (!this.ku(_local3, _local1)) {
return(false);
}
jy[_local3][_local1] = _local2;
_local2.kq = _local3;
_local2.kr = _local1;
return(true);
};
_local1.ku = function (u, v) {
var _local1 = v;
var _local2 = u;
if (jy[_local2][_local1]) {
return(false);
}
if ((_local1 < 0) || (_local1 > this.jn)) {
return(false);
}
if ((_local2 < 0) || (_local2 >= this.jm)) {
return(false);
}
return(true);
};
_local1.kw = function (kt) {
jy[kt.kq][kt.kr] = false;
};
_local1.kx = function () {
var _local1 = this;
if (((_local1.jo == 0) && (self.kd.length == 0)) && (_local1.jr == 0)) {
_local1.ky();
}
if ((((_local1.jo == 0) && (self.kd.length == 0)) && (_local1.jr == 0)) && (_local1.ke == 0)) {
_local1.kz();
}
if ((((_local1.jo == 0) && (self.kd.length == 0)) && (_local1.jr == 0)) && (_local1.ke == 0)) {
_local1.la();
}
if ((((_local1.jo == 0) && (self.kd.length == 0)) && (_local1.jr == 0)) && (_local1.ke == 0)) {
_local1.jp = _local1.jp + 2;
if (_local1.kf < _local1.cw) {
_local1.dc();
} else {
at.bd(_local1.cz);
jv = "level finished";
jw = 0;
}
}
};
_local1.dc = function () {
var _local1 = this;
if (jy[2][1]) {
at.bd(_local1.cz);
b.dg();
return(false);
}
_local1.cz.start(_local1.js[0].color, _local1.js[1].color, _local1.js[0].lb + _local1.js[1].lb);
f.an(_local1.js[0]);
f.an(_local1.js[1]);
_local1.js.splice(0, 2);
_local1.kh();
return(undefined);
};
_local1.ky = function () {
var _local1 = 0;
while (_local1 < jy.length) {
var lc = (jy[_local1].length - 1);
var _local3 = lc;
while (_local3 >= 0) {
if (jy[_local1][_local3]) {
if (lc > _local3) {
var _local2 = jy[_local1][_local3];
var ld = (lc - _local2.kr);
if (!_local2.lf) {
_local2.lf = true;
var gm = function () {
this.parent.jo--;
};
var o = {ao:_local2, v:_local2._y + (ld * this.jd), fg:gm};
this.lg(_local2);
if (jy[_local1 - 1][_local3].lh) {
f.an(jy[_local1 - 1][_local3].lh);
jy[_local1 - 1][_local3].lh = false;
}
if (jy[_local1][_local3 + 1].li) {
f.an(jy[_local1][_local3 + 1].li);
jy[_local1][_local3 + 1].li = false;
}
this.jz.lj(o);
this.jo++;
this.ks(_local2, _local1, lc);
}
}
lc--;
}
_local3--;
}
_local1++;
}
};
_local1.kz = function () {
var _local1 = this;
var lk = 0;
var gi;
var _local3 = new Array();
var u = 0;
while (u < jy.length) {
var v = (jy[u].length - 1);
while (v >= 0) {
if (jy[u][v]) {
if (jy[u][v].color < 10) {
if (!jy[u][v].lm) {
gi = ln(u, v, jy[u][v].color);
if (gi > 1) {
_local1.lo();
}
if (gi >= 4) {
var lp = _local1.lq();
lp = _local1.lr(lp[0], lp[1]);
_local3.push({ls:ju.length, jt:ju.slice(), lp:lp.slice()});
lk++;
}
ju = new Array();
}
}
} else {
v = 0;
}
v--;
}
u++;
}
_local3.sortOn("len");
var _local2 = 0;
while (_local2 < _local3.length) {
ju = _local3[_local2].jt;
var lu = _local1.lv();
var lw = _local1.lx();
var ly = b.ds();
var lz = b.ck({action:"flowers cleared", value:_local3[_local2].ls});
_local1.dk = _local1.dk + _local3[_local2].ls;
_local1.kf = _local1.kf + _local3[_local2].ls;
b.ch.gh(Math.max(0, _local1.cw - _local1.kf));
ma();
var mb = (_local1.jd * 2);
if (lu > 0) {
}
if (lw) {
}
aj("combo:", ly);
if (ly > 2) {
var mc = Math.min(ly, 7);
new md({t:"bonus_flower", u:_local3[_local2].lp[0], v:_local3[_local2].lp[1], me:mc});
mb = _local1.jd;
}
new ig(_local3[_local2].lp[0] + (_local1.jd / 2), _local3[_local2].lp[1] + (_local1.jd / 2), lz, mb);
_local2++;
}
ju = new Array();
_local1.mf();
};
_local1.lo = function () {
var ls = ju.length;
var _local2 = 0;
while (_local2 < ls) {
var _local1 = ju[_local2];
if ((_local1.color < 10) && (jy[_local1.kq][_local1.kr - 1].color == _local1.color)) {
if (!_local1.li) {
_local1.li = f.n({t:"gren_vert", u:_local1._x, v:_local1._y - (this.jd / 2)});
_local1.li.ad();
}
}
if ((_local1.color < 10) && (jy[_local1.kq + 1][_local1.kr].color == _local1.color)) {
if (!_local1.lh) {
_local1.lh = f.n({t:"gren_horiz", u:_local1._x + (this.jd / 2), v:_local1._y});
_local1.lh.ad();
}
}
_local2++;
}
};
_local1.lg = function (kt) {
var _local1 = kt;
if (_local1.li) {
f.an(_local1.li);
}
if (_local1.lh) {
f.an(_local1.lh);
}
_local1.li = false;
_local1.lh = false;
};
_local1.lv = function () {
var _local3 = ju.length;
var _local2 = new Array();
if (_local3 < this.jm) {
return(0);
}
var _local1 = 0;
while (_local1 < _local3) {
_local2[ju[_local1].kr]++;
_local1++;
}
var mh = 0;
_local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == this.jm) {
mh++;
aj("Row Bonus!");
}
_local1++;
}
return(mh);
};
_local1.lx = function () {
var ls = ju.length;
var mi = new Array();
var _local3 = new Array();
if (ls != 5) {
return(0);
}
var _local1 = 0;
while (_local1 < ls) {
mi[ju[_local1].kr]++;
var _local2 = _local3[ju[_local1].kr];
if (typeof(_local2) != "number") {
_local2 = ju[_local1].kq;
} else {
_local2 = Math.min(_local2, ju[_local1].kq);
}
_local3[ju[_local1].kr] = _local2;
_local1++;
}
_local1 = 0;
while (_local1 < mi.length) {
if (mi[_local1] > 1) {
return(0);
}
if (((mi[_local1] == 1) && (mi[_local1 + 1] == 3)) && (mi[_local1 + 2] == 1)) {
if ((_local3[_local1] == _local3[_local1 + 2]) && ((_local3[_local1] - 1) == _local3[_local1 + 1])) {
aj("Cross Bonus!");
return(1);
}
}
_local1++;
}
return(0);
};
_local1.lq = function () {
var ls = ju.length;
var _local3 = 0;
var _local2 = 0;
var ls = ju.length;
var _local1 = 0;
while (_local1 < ls) {
_local3 = _local3 + ju[_local1].kq;
_local2 = _local2 + ju[_local1].kr;
_local1++;
}
_local3 = Math.round((_local3 / ls) - 0.1);
_local2 = Math.round((_local2 / ls) - 0.1);
return([_local3, _local2]);
};
_local1.mk = function (kt) {
var _local2 = kt;
var _local3 = this;
var _local1;
_local1 = jy[_local2.kq - 1][_local2.kr];
if (((_local1.color >= 10) && (_local1.color < 20)) && (!_local1.kp)) {
at.ax(_local1.kn);
_local3.ke++;
_local1.kp = true;
}
_local1 = jy[_local2.kq][_local2.kr - 1];
if (((_local1.color >= 10) && (_local1.color < 20)) && (!_local1.kp)) {
at.ax(_local1.kn);
_local3.ke++;
_local1.kp = true;
}
_local1 = jy[_local2.kq + 1][_local2.kr];
if (((_local1.color >= 10) && (_local1.color < 20)) && (!_local1.kp)) {
at.ax(_local1.kn);
_local3.ke++;
_local1.kp = true;
}
_local1 = jy[_local2.kq][_local2.kr + 1];
if (((_local1.color >= 10) && (_local1.color < 20)) && (!_local1.kp)) {
at.ax(_local1.kn);
_local3.ke++;
_local1.kp = true;
}
};
_local1.mp = function (color) {
var _local1;
var _local3 = 0;
while (_local3 < jy.length) {
var _local2 = jy[_local3].length - 1;
while (_local2 >= 0) {
_local1 = jy[_local3][_local2];
if ((_local1.color == color) && (!_local1.kp)) {
at.ax(_local1.kn);
this.ke++;
_local1.kp = true;
}
_local2--;
}
_local3++;
}
};
_local1.la = function () {
var _local3 = this;
var _local2 = 0;
while (_local2 < jy.length) {
var _local1 = jy[_local2].length - 1;
while (_local1 >= 0) {
if ((jy[_local2][_local1].color == "quicksilver") && (!jy[_local2][_local1].lm)) {
aj("quick found!");
var mq = jy[_local2][_local1];
mq.lm = true;
jt.push(mq);
ju.push(mq);
if ((jy[_local2][_local1 + 1] && (jy[_local2][_local1 + 1].color >= 10)) && (jy[_local2][_local1 + 1].color < 20)) {
_local3.mp(jy[_local2][_local1 + 1].color);
}
if ((jy[_local2][_local1 + 1] && (jy[_local2][_local1 + 1].color < 10)) || (jy[_local2][_local1 + 1].color == "stone")) {
mr(jy[_local2][_local1 + 1].color);
}
var gi = ju.length;
var lz = b.ck({action:"quicksilver", value:gi});
_local3.dk = _local3.dk + gi;
_local3.kf = _local3.kf + gi;
b.ch.gh(Math.max(0, _local3.cw - _local3.kf));
ma();
ju = new Array();
bh.bs("snd_flower_1.wav", "flower");
}
_local1--;
}
_local2++;
}
_local3.mf();
};
_local1.ki = function () {
var _local2 = this;
_local2.jr = Math.max(_local2.jr - 1, 0);
if (_local2.kd.length > 0) {
var _local1 = 0;
while (_local1 < _local2.kd.length) {
if ((_local2.kd[_local1].mt--) <= 0) {
_local2.kd[_local1].mt = null;
ml(_local2.kd[_local1]);
kb(_local2.kd[_local1]);
_local2.kd.splice(_local1, 1);
_local2.jr = 6;
_local1--;
} else if (_local2.kd[_local1].mt < 8) {
var _local3 = 50 + (((_local2.kd[_local1].mt / 2) % 2) * 50);
_local2.kd[_local1]._alpha = _local3;
if (_local2.kd[_local1].lh) {
_local2.kd[_local1].lh._alpha = _local3;
}
if (_local2.kd[_local1].li) {
_local2.kd[_local1].li._alpha = _local3;
}
}
_local1++;
}
}
};
_local1.mf = function () {
var _local2 = jt.length;
var _local1 = 0;
while (_local1 < _local2) {
jt[_local1].lm = false;
_local1++;
}
jt = new Array();
};
_local1.mu = function (mv, element) {
var _local2 = mv;
var _local3 = element;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1] == _local3) {
return(_local1);
}
_local1++;
}
return(-1);
};
_local1.kh = function () {
var _local1 = this;
var mw;
var kl;
var _local3;
var _local2;
var mx = 502;
var my = 6;
var k = _local1.js.length;
while (k < _local1.jq) {
var mc = new String(_local1.ji[Math.floor(_local1.jj / 2)]);
mc = mc.substr((_local1.jj % 2) * 2, 2);
_local1.jj = (_local1.jj + 1) % (_local1.ji.length * 2);
mw = _local1.mu(_local1.jf, mc);
if (mc == _local1.jg) {
mw = "quicksilver";
kl = "poisonman";
_local3 = {t:kl, u:mx, v:my - (k * _local1.jd)};
_local2 = f.n(_local3);
var ek = new fn({ao:_local2});
ek.stop();
} else if (mc == _local1.jh) {
mw = "stone";
kl = "flowerman";
_local3 = {t:kl, u:mx, v:my - (k * _local1.jd)};
_local2 = f.n(_local3);
var ek = new fn({ao:_local2});
ek.stop();
} else if (mw >= 10) {
kl = _local1.je[mw - 10] + "_anim";
_local3 = {t:kl, u:mx, v:my - (k * _local1.jd)};
_local2 = f.n(_local3);
var ek = new fn({ao:_local2});
ek.stop();
_local2.kn = ek;
} else {
kl = _local1.je[mw];
_local3 = {t:kl, u:mx, v:my - (k * _local1.jd)};
_local2 = f.n(_local3);
}
_local2.color = mw;
_local2.lb = mc;
_local1.js.push(_local2);
k++;
}
var k = 0;
while (k < _local1.js.length) {
_local1.js[k]._y = (my + _local1.jd) - (k * _local1.jd);
k++;
}
};
_local1.mz = function (gi) {
var _local2 = this;
var mw;
var kl;
var o;
var km;
var _local3 = "";
var k = 0;
while (k < gi) {
var _local1 = random.eu(0, 49);
if (_local1 == 1) {
_local3 = _local3 + _local2.jg;
} else if ((_local1 >= 10) && (_local1 < 15)) {
_local3 = _local3 + _local2.jh;
} else if ((_local1 >= 20) && (_local1 < 25)) {
mw = random.eu(0, _local2.je.length - 1) + 10;
_local3 = _local3 + _local2.jf[mw];
} else {
mw = random.eu(0, _local2.je.length - 1);
_local3 = _local3 + _local2.jf[mw];
}
if ((k % 2) == 1) {
_local3 = _local3 + " ";
}
k++;
}
return(_local3);
};
_local1.lr = function (u, v) {
var _local1 = this;
return([_local1.jk + (u * _local1.jd), _local1.jl + ((v + 1) * _local1.jd)]);
};
_local1.kj = function () {
var _local1 = this;
switch (jv) {
case "level finished" :
if (jw >= 15) {
aj("do the bonus work");
_local1.nc = _local1.nd();
jv = "bonus done";
jw = 0;
}
break;
case "bonus done" :
if (jw >= 86) {
aj("bonus done");
if ((_local1.cx + 1) <= 3) {
_local1.nf();
_local1.ng();
}
b.ck({action:"empty rows bonus", value:_local1.nc.nh});
b.ck({action:"empty squares bonus", value:_local1.nc.ni});
b.ck({action:"end level", value:_local1.cx});
jv = "show level sign";
jw = 0;
}
break;
case "show level sign" :
if (jw >= 6) {
aj("show level sign done");
if ((_local1.cx + 1) <= 3) {
jv = "kill done";
jw = 0;
} else {
b.dg("all cleared");
jv = "game over";
jw = 0;
}
}
break;
case "kill done" :
if (jw < 35) {
break;
}
aj("go to next level");
_local1.ka();
b.cn();
jv = "init done";
jw = 0;
}
jw++;
};
_local1.nd = function () {
var _local1 = this;
var nh = 0;
var ni = 0;
var _local3;
var fi;
var v = 1;
while (v < (_local1.jn + 1)) {
_local3 = 0;
var u = 0;
while (u < _local1.jm) {
if (jy[u][v]) {
_local3++;
}
u++;
}
if (_local3 == 0) {
nh++;
} else {
ni = ni + (_local1.jm - _local3);
}
var nk = b.dr();
var u = 0;
while (u < _local1.jm) {
if (!jy[u][v]) {
fi = ((_local3 == 0) ? (v * 5) : ((v * 5) + u));
var nl = _local1.lr(u, v);
var mm = {t:"bonus_flower", z:0, u:nl[0], v:nl[1]};
var _local2 = f.n(mm);
_local2.nm = ((u + _local1.jn) - v) / 2;
if ((_local3 > 0) || (u == 2)) {
var nn = ((_local2._x + (_local1.jd / 2)) + ((_local3 == 0) ? (_local1.jd / 2) : 0));
var no = ((_local3 == 0) ? 100 : 10);
no = no * nk;
new ig(nn, _local2._y + (_local1.jd / 2), Math.round(no), _local1.jd, fi + 4, 10);
}
new ez({ao:_local2, fi:fi, fb:"in", frames:6});
jx.push(_local2);
}
u++;
}
v++;
}
return({nh:nh, ni:ni});
};
_local1.ng = function () {
var ls = jx.length;
var _local1 = 0;
while (_local1 < ls) {
var _local2 = function () {
f.an(this.fa);
};
new ez({ao:jx[_local1], fi:jx[_local1].nm, fb:"out", frames:3, fg:_local2});
jx[_local1].nm = null;
_local1++;
}
};
_local1.nf = function () {
var _local2 = 0;
while (_local2 < this.jm) {
var _local1 = 0;
while (_local1 < (this.jn + 1)) {
var _local3 = ((_local2 + this.jn) - _local1) / 2;
if (jy[_local2][_local1]) {
new ez({ao:jy[_local2][_local1], fi:_local3, fb:"out", frames:3});
if (jy[_local2][_local1].lh) {
new ez({ao:jy[_local2][_local1].lh, fi:_local3, fb:"out", frames:3});
}
if (jy[_local2][_local1].li) {
new ez({ao:jy[_local2][_local1].li, fi:_local3, fb:"out", frames:3});
}
}
_local1++;
}
_local2++;
}
};
_local1.cu = function () {
var _local2 = this;
_local2.cx++;
b.ck({action:"new level", value:_local2.cx});
var _local1 = 0;
while (_local1 < _local2.js.length) {
f.an(_local2.js[_local1]);
_local1++;
}
_local2.js = new Array();
return(_local2.cx);
};
}
function kg() {
var _local1 = this;
var pi = Math.PI;
_local1.nq = f.n({t:"flower_outline", y:false});
_local1.nq.ag();
_local1.cq = function (parent) {
var _local1 = this;
_local1.nr = 13;
_local1.hg = 1;
_local1.parent = parent;
_local1.ns = false;
_local1.nt = 1;
at.ax(_local1);
_local1.nu = 2;
_local1.nv = [[0, 1], [-1, 0], [0, -1], [1, 0]];
_local1.da(1);
_local1.lb = "";
};
_local1.da = function (bn) {
var _local1 = this;
_local1.hg = Math.min(bn, _local1.nr);
if (_local1.hg == 1) {
_local1.nw = [1, 3, 7, 10, 6, 4, 2, 1];
var _local2 = 0;
while (_local2 < 14) {
_local1.nw.push(0);
_local2++;
}
} else if (_local1.hg < 10) {
_local1.nw = [1, 3, 7, 10, 6, 4, 2, 1];
var _local2 = 0;
while (_local2 < (9 - _local1.hg)) {
_local1.nw.push(0);
_local2++;
}
} else if (_local1.hg == 10) {
_local1.nw = [2, 3, 7, 10, 6, 4, 2];
} else if (_local1.hg == 11) {
_local1.nw = [2, 5, 7, 12, 6, 2];
} else if (_local1.hg == 12) {
_local1.nw = [4, 8, 12, 9, 3];
} else if (_local1.hg == 13) {
_local1.nw = [8, 12, 10, 4];
}
};
_local1.start = function (nx, ny, lb) {
var _local1 = this;
_local1.ns = true;
_local1.nx = nx;
_local1.ny = ny;
_local1.lb = lb;
_local1.nz = 0;
_local1.oa = false;
_local1.nu = 2;
_local1.ob = _local1.nu;
_local1.oc = _local1.parent.kk(2, nx, 1);
_local1.od = _local1.parent.kk(2, ny, 0);
_local1.oc.lf = true;
_local1.od.lf = true;
_local1.oe = 0;
if (typeof(_local1.nx) == "number") {
if (_local1.nx < 10) {
_local1.nq._x = _local1.oc._x;
_local1.nq._y = _local1.oc._y;
_local1.nq._visible = true;
_local1.of = 0;
}
}
_local1.og = 0;
_local1.oh = new Array();
_local1.oi = pi;
};
_local1.ay = function () {
var _local1 = this;
_local1.parent.kw(_local1.oc);
_local1.parent.kw(_local1.od);
if (_local1.ns) {
_local1.oj();
_local1.ok();
_local1.ol();
}
_local1.om();
_local1.parent.kv(_local1.oc, _local1.oc.kq, _local1.oc.kr);
_local1.parent.kv(_local1.od, _local1.od.kq, _local1.od.kr);
if ((!_local1.ns) && (_local1.oh.length == 0)) {
_local1.parent.kx();
}
};
_local1.isActive = function () {
return(this.ns || (this.oh.length > 0));
};
_local1.oj = function () {
var _local1 = this;
if (b.co.oo("left")) {
if (_local1.parent.ku(_local1.oc.kq - 1, _local1.oc.kr) && (_local1.parent.ku(_local1.od.kq - 1, _local1.od.kr))) {
_local1.oc._x = _local1.oc._x - _local1.parent.jd;
_local1.oc.kq--;
_local1.od._x = _local1.od._x - _local1.parent.jd;
_local1.od.kq--;
}
}
if (b.co.oo("right")) {
if (_local1.parent.ku(_local1.oc.kq + 1, _local1.oc.kr) && (_local1.parent.ku(_local1.od.kq + 1, _local1.od.kr))) {
_local1.oc._x = _local1.oc._x + _local1.parent.jd;
_local1.oc.kq++;
_local1.od._x = _local1.od._x + _local1.parent.jd;
_local1.od.kq++;
}
}
if (b.co.oo("down")) {
_local1.oa = true;
}
if (b.co.isDown("down") && (_local1.oa)) {
_local1.nt = 34;
} else {
_local1.nt = 1;
}
if (b.co.oo("button1") || (b.co.oo("button2"))) {
var op = (b.co.oo("button2") ? 1 : -1);
var _local2 = (_local1.nu + op) % 4;
if (_local2 < 0) {
_local2 = _local2 + 4;
}
var _local3 = _local1.nv[_local2];
if (_local1.parent.ku(_local1.oc.kq + _local3[0], _local1.oc.kr + _local3[1])) {
_local1.od.kq = _local1.oc.kq + _local3[0];
_local1.od.kr = _local1.oc.kr + _local3[1];
if (_local1.ob != _local1.nu) {
_local1.ou(_local1.nu);
}
_local1.ou(_local2);
_local1.ob = _local2;
} else if (_local3[0] != 0) {
if (_local1.parent.ku(_local1.oc.kq - _local3[0], _local1.oc.kr)) {
_local1.oc._x = _local1.oc._x - (_local3[0] * _local1.parent.jd);
_local1.od.kq = _local1.oc.kq;
_local1.od.kr = _local1.oc.kr;
_local1.oc.kq = _local1.oc.kq - _local3[0];
if (_local1.ob != _local1.nu) {
_local1.ou(_local1.nu);
}
_local1.ou(_local2);
_local1.ob = _local2;
}
}
_local1.nu = _local2;
bh.play("snd_rotate.wav");
}
};
_local1.ok = function () {
var _local1 = this;
var _local2 = 0;
if (_local1.nt > 1) {
_local2 = _local2 + _local1.nt;
} else {
_local2 = _local2 + _local1.nw[_local1.oe];
}
_local1.oe++;
_local1.nz = _local1.nz + _local2;
if (_local1.nz > _local1.parent.jd) {
var _local3 = _local1.nz - _local1.parent.jd;
_local2 = _local2 - _local3;
_local1.nz = _local1.parent.jd;
}
if ((_local1.oe >= _local1.nw.length) || ((_local1.nt > 1) && (_local1.nz >= _local1.parent.jd))) {
_local1.oe = 0;
_local1.nz = _local1.nz - _local1.parent.jd;
if (_local1.parent.ku(_local1.oc.kq, _local1.oc.kr + 1) && (_local1.parent.ku(_local1.od.kq, _local1.od.kr + 1))) {
_local1.oc.kr = _local1.oc.kr + 1;
_local1.od.kr = _local1.od.kr + 1;
} else {
_local1.ns = false;
_local1.oc.lf = false;
_local1.od.lf = false;
_local1.nq._visible = false;
b.ck({action:"drop", value:(((("" + _local1.lb) + " ") + (_local1.oc.kq + 1)) + " ") + (((_local1.nu + 2) % 4) + 1)});
bh.play("snd_land.wav", true);
}
}
_local1.oc._y = _local1.oc._y + _local2;
_local1.od._y = _local1.od._y + _local2;
_local1.nq._x = _local1.oc._x;
_local1.nq._y = _local1.oc._y;
};
_local1.ou = function (target) {
var _local3 = this;
var ow = 4;
var _local2;
if (_local3.oh.length > 0) {
_local2 = _local3.oh[_local3.oh.length - 1];
} else {
_local2 = _local3.oi;
}
if ((target == 3) && (Math.round(_local2) == 0)) {
_local2 = _local2 + (2 * pi);
}
if ((target == 0) && (Math.round((2 * _local2) / pi) == 3)) {
_local2 = _local2 - (2 * pi);
}
var oy = ((target * pi) / 2);
var oz = ((oy - _local2) / (ow - 1));
var _local1 = 0;
while (_local1 < ow) {
_local3.oh.push(_local2 + (oz * _local1));
_local1++;
}
};
_local1.om = function () {
var _local1 = this;
if (_local1.oh.length == 0) {
} else {
var _local2 = _local1.oh[0];
_local1.oi = _local2;
_local1.oh.splice(0, 1);
_local1.od._x = _local1.oc._x - (Math.sin(_local2) * _local1.parent.jd);
_local1.od._y = _local1.oc._y + (Math.cos(_local2) * _local1.parent.jd);
}
};
_local1.pa = function () {
var _local2 = this;
if (_local2.pb == null) {
} else {
_local2.og = _local2.og + 0.25;
var _local1 = Math.round(Math.cos(_local2.og) * 50) + 10;
var _local3 = {ra:"100", rb:_local1, ga:"100", gb:_local1, ba:"100", bb:_local1, aa:"100", ab:"0"};
_local2.pb.setTransform(_local3);
}
};
_local1.pe = function () {
var _local1 = this;
_local1.pb.setTransform(_local1.pf);
_local1.pb = null;
};
_local1.ol = function () {
var _local1 = this;
_local1.of = _local1.of + 0.23;
var _local2 = Math.round(30 + (Math.cos(_local1.of) * 30));
_local1.nq._alpha = _local2;
};
}
function jz(_parent) {
var pg = new Array();
var ph = [36];
var parent = _parent;
this.start = function () {
at.ax(this);
};
this.lj = function (o) {
var _local2 = o;
var _local1 = new Object();
_local1.ao = _local2.ao;
_local1.il = _local1.ao._y;
_local1.im = _local1.il;
_local1.ao.pk = ((typeof(_local2.v) == "number") ? (_local2.v) : (_local1.il));
_local1.ix = _local1.il != _local1.ao.pk;
_local1.parent = parent;
_local1.fg = _local2.fg;
_local1.pl = 0;
_local1.hg = 0;
pg.push(_local1);
};
this.ay = function () {
var _local2;
var nn;
var pm;
var pn = false;
var _local1 = 0;
while (_local1 < pg.length) {
_local2 = pg[_local1].ao;
pg[_local1].hg = ph[pg[_local1].pl];
pg[_local1].im = Math.min(pg[_local1].im + pg[_local1].hg, _local2.pk);
_local2._y = pg[_local1].im;
pg[_local1].pl = Math.min(pg[_local1].pl + 1, ph.length - 1);
if (pg[_local1].im == _local2.pk) {
_local2.lf = false;
if (pg[_local1].fg) {
pg[_local1].fg();
}
pg.splice(_local1, 1);
_local1--;
bh.play("snd_land.wav");
}
_local1++;
}
};
}
function md(o) {
var _local3 = o;
this.po = new Array();
this.pp = 0;
var _local2;
var k = 0;
while (k < _local3.me) {
_local2 = f.n({t:_local3.t, u:_local3.u, v:_local3.v, z:0});
_local2.pp = ((k * Math.PI) * 2) / _local3.me;
_local2.pq = 0.1;
_local2.pr = -0.001;
_local2.ps = 0;
_local2.pt = 0;
_local2.pu = 6;
_local2.pv = -0.2;
_local2.pw;
_local2.px = _local3.u;
_local2.py = _local3.v;
_local2.pz = 20;
_local2.qa = 16;
_local2.ag();
this.po.push(_local2);
k++;
}
this.ir = 14;
this.ay = function () {
var _local3 = this;
if (_local3.ir > 0) {
_local3.ir--;
} else {
var _local1;
var _local2 = 0;
while (_local2 < _local3.po.length) {
_local1 = _local3.po[_local2];
_local1.pp = _local1.pp + _local1.pq;
_local1.pq = _local1.pq + _local1.pr;
_local1.pt = _local1.pt + _local1.pu;
_local1.pu = _local1.pu + _local1.pv;
_local1.pu = Math.max(0, _local1.pu);
_local1._x = _local1.px + (Math.cos(_local1.pp) * _local1.pt);
_local1._y = _local1.py + (Math.sin(_local1.pp) * _local1.pt);
_local1.ps++;
if (_local1.ps > _local1.qa) {
_local1._alpha = ((_local1.pz - _local1.ps) / (_local1.pz - _local1.qa)) * 100;
} else {
_local1._alpha = 100;
}
if (_local1.ps > _local1.pz) {
_local3.po.splice(_local2, 1);
f.an(_local1);
_local2--;
}
_local2++;
}
if (_local3.po.length == 0) {
at.bd(_local3);
}
}
};
at.ax(this);
}
function ez(o) {
var _local1 = this;
var _local2 = o;
_local1.fa = _local2.ao;
_local1.fb = ((typeof(_local2.fb) == "string") ? (_local2.fb) : "in");
_local1.fc = _local2.frames || 10;
_local1.fd = _local1.fc;
_local1.fe = 100 / _local1.fc;
if (_local1.fb == "in") {
_local1.fe = -_local1.fe;
_local1.ff = 0;
} else {
_local1.ff = 100;
}
_local1.fg = _local2.fg;
_local1.fi = _local2.fi || 0;
_local1.ay = function () {
var _local1 = this;
if (_local1.fi > 0) {
_local1.fi--;
} else {
_local1.fd--;
_local1.ff = _local1.ff - _local1.fe;
_local1.fa._alpha = _local1.ff;
if (_local1.fd == 0) {
if (_local1.fb == "pulse") {
_local1.fd = _local1.fc;
_local1.fe = -_local1.fe;
} else {
at.bd(_local1);
if (_local1.fg) {
_local1.fg();
}
}
}
}
};
at.ax(_local1);
}
function cp() {
var _local1 = this;
_local1.qb = new Object();
_local1.qb.left = false;
_local1.qb.right = false;
_local1.qb.up = false;
_local1.qb.down = false;
_local1.qb.button1 = false;
_local1.qb.button2 = false;
_local1.qb.button3 = false;
_local1.qc = new Object();
_local1.qc.left = false;
_local1.qc.right = false;
_local1.qc.up = false;
_local1.qc.down = false;
_local1.qc.button1 = false;
_local1.qc.button2 = false;
_local1.qc.button3 = false;
_local1.qd = new Object();
_local1.qd.left = false;
_local1.qd.right = false;
_local1.qd.up = false;
_local1.qd.down = false;
_local1.qd.button1 = false;
_local1.qd.button2 = false;
_local1.qd.button3 = false;
_local1.frame = 0;
_local1.cq = function () {
at.ax(this);
};
_local1.isDown = function (key) {
return(this.qb[key]);
};
_local1.oo = function (key) {
return(this.qb[key] && (this.qc[key]));
};
_local1.qe = function (key) {
return(this.qc[key]);
};
_local1.ay = function () {
var _local1 = this;
_local1.qc.right = _local1.qb.right != (Key.isDown(39) || (_local1.qd.right));
_local1.qb.right = Key.isDown(39) || (_local1.qd.right);
_local1.qc.left = _local1.qb.left != (Key.isDown(37) || (_local1.qd.left));
_local1.qb.left = Key.isDown(37) || (_local1.qd.left);
_local1.qc.up = _local1.qb.up != (Key.isDown(38) || (_local1.qd.up));
_local1.qb.up = Key.isDown(38) || (_local1.qd.up);
_local1.qc.down = _local1.qb.down != (Key.isDown(40) || (_local1.qd.down));
_local1.qb.down = Key.isDown(40) || (_local1.qd.down);
_local1.qc.button1 = _local1.qb.button1 != (Key.isDown(86) || (_local1.qd.button1));
_local1.qb.button1 = Key.isDown(86) || (_local1.qd.button1);
_local1.qc.button2 = _local1.qb.button2 != (Key.isDown(66) || (_local1.qd.button2));
_local1.qb.button2 = Key.isDown(66) || (_local1.qd.button2);
_local1.qc.button3 = _local1.qb.button3 != (Key.isDown(32) || (_local1.qd.button3));
_local1.qb.button3 = Key.isDown(32) || (_local1.qd.button3);
};
_local1.gd = function (key) {
this.qd[key] = true;
};
_local1.gf = function (key) {
this.qd[key] = false;
};
}
Stage.showMenu = false;
Stage.scaleMode = "noScale";
f = new g();
at = new au();
bh = new bi();
var bv = false;
var bw = "1.1.3";
if (bv) {
var dx = new XML();
dx.ignoreWhite = true;
dx.onData = function (src) {
gameData = src;
};
dx.load("gamedata.xml");
}
random = new Random();
stop();
startup();