home *** CD-ROM | disk | FTP | other *** search
Text File | 2006-06-13 | 27.6 KB | 1,039 lines |
- class JigSet
- {
- var clip;
- var pointsclip;
- var pieces;
- var mark;
- var order;
- var pointsclist;
- var compliments;
- var opposites;
- var callback;
- var bgm;
- var mainvol;
- var sound;
- var soundmode;
- var soundfx;
- var start;
- var sitemode;
- var scoresent;
- var userid;
- var usertype;
- var ground;
- var stack;
- var freecols;
- var timemode;
- var clawdir;
- var clawqueue;
- var lastmod;
- var pointsi;
- var holdmeter;
- var mutexpiece;
- var turn;
- var tickcount;
- var tickbase;
- var countleveler;
- var countsculptor;
- var countdrill;
- var countflaws;
- var score;
- var combo;
- var flawpiece;
- var flawpieceinv;
- var active;
- var nextpiece;
- var clawclip;
- var holdclip;
- var difficulty;
- var speedbase;
- var playmode;
- var backclip;
- var starttime;
- var keylistener;
- var ref;
- var attachSound;
- var onSoundComplete;
- var bgmchannels = 2;
- var height = 12;
- var width = 8;
- var psizex = 40;
- var psizey = 40;
- var offx = 120;
- var offy = 120;
- var clawspeed = 50;
- var flawscore = -100;
- var drillscore = -20;
- var sculptorscore = -20;
- var levelerscore = -20;
- var landscore = 100;
- var allowedflaws = 40;
- var accel = 0;
- var accelmax = 10;
- var accelrate = 0.4;
- var holdmax = 400;
- var holdregen = 0.15;
- var flawtimetick = 0;
- var flawtime = 5;
- var flawcount = 0;
- var flawlimit = 6;
- var timelimit = 360;
- var tickdiv = 15;
- var username = "";
- function JigSet()
- {
- this.clip = _root.pieces;
- this.pointsclip = _root.createEmptyMovieClip("points",1);
- this.pieces = new Array();
- this.mark = new Array();
- this.order = new Array();
- this.pointsclist = new Array();
- this.compliments = new Array(0,2,1);
- this.opposites = new Array(2,3,0,1);
- this.callback = new Array();
- this.bgm = new Array();
- this.bgm[0] = new SoundChannel(true);
- this.bgm[0].SetPlaylist(new Array(new SoundPhrase("BGM_Jig")));
- this.mainvol = new Sound();
- var _loc3_ = _root.createEmptyMovieClip("sidesound",4094);
- this.sound = new Sound(_loc3_);
- this.soundmode = 0;
- var _loc4_ = _root.createEmptyMovieClip("sidesoundfx",4093);
- this.soundfx = new Sound(_loc4_);
- this.IntroSound();
- _root.createEmptyMovieClip("timertick",5000);
- _root.timertick.onEnterFrame = _root.tick;
- _root.timertick.gotoAndPlay(1);
- }
- function IntroSound()
- {
- if(this.soundmode != 9999)
- {
- this.sound.attachSound("Intro");
- this.sound.setVolume(100);
- this.sound.start();
- this.soundmode = 9999;
- this.sound.onSoundComplete = function()
- {
- this.start();
- };
- }
- }
- function AddPiece()
- {
- var _loc4_ = new JigPiece();
- this.pieces.push(_loc4_);
- var _loc3_ = 3;
- var _loc5_ = _root.randn(_loc3_);
- var _loc6_ = _root.randn(_loc3_);
- var _loc7_ = _root.randn(_loc3_);
- var _loc8_ = _root.randn(_loc3_);
- _loc4_.Create(this,this.pieces.length - 1,_loc5_,_loc7_,_loc6_,_loc8_);
- return _loc4_;
- }
- function StatusReport()
- {
- }
- function Init()
- {
- this.StatusReport();
- this.SoundEffect("Menu");
- if(_root._url.indexOf("endgameradio.com") != -1)
- {
- this.sitemode = 1;
- }
- else
- {
- this.sitemode = 0;
- }
- this.scoresent = 0;
- if(_root.username)
- {
- this.username = _root.username;
- this.userid = _root.userid;
- this.usertype = 1;
- }
- this.ground = new Array(12,12,12,12,12,12,12,12);
- this.stack = new Array();
- this.freecols = new Array(0,1,2,3,4,5,6,7);
- var _loc7_ = 0;
- while(_loc7_ < 8)
- {
- this.stack[_loc7_] = new Array();
- _loc7_ = _loc7_ + 1;
- }
- this.sound.stop();
- this.soundmode = 0;
- this.timemode = 0;
- this.clawdir = 0;
- this.clawqueue = 0;
- this.lastmod = 0;
- this.pointsi = 0;
- this.usertype = 0;
- this.holdmeter = this.holdmax;
- this.mutexpiece = false;
- this.turn = 0;
- this.timemode = 0;
- this.tickcount = 0;
- this.tickbase = 0;
- this.countleveler = 0;
- this.countsculptor = 0;
- this.countdrill = 0;
- this.countflaws = 0;
- this.score = 0;
- this.combo = 0;
- this.flawpiece = new JigPiece();
- this.flawpiece.Create(this,9999,0,0,0,0);
- this.flawpieceinv = new JigPiece();
- this.flawpieceinv.Create(this,9998,0,0,0,0);
- this.clip.loadVariables("http://endgameradio.com/smack.php");
- var _loc8_ = this.AddPiece();
- this.active = _loc8_;
- this.nextpiece = this.AddPiece();
- this.nextpiece.NextPiece();
- _loc8_.Begin();
- this.clawclip = _root.claw;
- this.holdclip = _root.holdbar;
- switch(this.difficulty)
- {
- case 1:
- this.speedbase = Math.floor(this.tickdiv * 2);
- this.allowedflaws = 40;
- break;
- case 2:
- this.speedbase = this.tickdiv;
- this.allowedflaws = 20;
- break;
- case 3:
- this.speedbase = Math.floor(this.tickdiv * 0.66);
- this.allowedflaws = 10;
- }
- switch(this.playmode)
- {
- case "basic":
- case "sudden":
- break;
- case "speed":
- this.timelimit = 120 * (4 - this.difficulty);
- break;
- case "leveler":
- case "sculptor":
- case "driller":
- break;
- case "bare":
- this.clawclip._alpha = 0;
- this.holdclip._alpha = 0;
- }
- _root.textflaws.text = this.allowedflaws;
- var _loc5_ = undefined;
- var _loc6_ = undefined;
- this.backclip = _root.backblocks;
- this.backclip._alpha = 100;
- var _loc4_ = 0;
- while(_loc4_ < this.height)
- {
- var _loc3_ = 0;
- while(_loc3_ < this.width)
- {
- _loc5_ = _loc4_ * this.width + _loc3_;
- _loc6_ = this.backclip.attachMovie("JigBlock","b" + _loc5_,_loc5_);
- _loc6_._x = this.psizex * _loc3_ + this.offx - this.psizex * 0.5;
- _loc6_._y = this.psizey * _loc4_ + this.offy - this.psizex * 0.5;
- _loc3_ = _loc3_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- var _loc9_ = new Date();
- this.starttime = Math.floor(_loc9_.getTime() / 1000);
- this.keylistener = new Object();
- this.keylistener.ref = this;
- this.keylistener.onKeyDown = function()
- {
- switch(Key.getCode())
- {
- case 37:
- case 65:
- this.ref.KeyLeft();
- break;
- case 39:
- case 68:
- this.ref.KeyRight();
- break;
- case 38:
- case 87:
- this.ref.KeyUp();
- break;
- case 40:
- case 83:
- this.ref.KeyDown();
- break;
- case 32:
- this.ref.KeyHold();
- break;
- case 70:
- this.ref.KeyDrop();
- break;
- case 86:
- this.ref.KeyAccel();
- break;
- case 90:
- this.ref.KeySculptor();
- break;
- case 88:
- this.ref.KeyLeveler();
- break;
- case 67:
- this.ref.KeyDrill();
- }
- };
- this.keylistener.onKeyUp = function()
- {
- switch(Key.getCode())
- {
- case 32:
- this.ref.KeyUnHold();
- break;
- case 86:
- this.ref.KeyUnAccel();
- }
- };
- Key.addListener(this.keylistener);
- _loc7_ = 0;
- while(_loc7_ < this.bgm.length)
- {
- this.bgm[_loc7_].Play();
- _loc7_ = _loc7_ + 1;
- }
- this.callback.timer = this.TickTimer;
- this.callback.frame = this.TickFrame;
- this.callback.fall = this.TickJumpFall;
- }
- function ViewScores()
- {
- var _loc2_ = undefined;
- switch(this.difficulty)
- {
- case 1:
- _loc2_ = "easy";
- break;
- case 2:
- _loc2_ = "normal";
- break;
- case 3:
- _loc2_ = "hard";
- }
- getURL("http://endgameradio.com/score.php?game=1&mode=" + this.playmode + "-" + _loc2_,"_blank");
- }
- function SubmitScore()
- {
- var _loc4_ = this.GetFinalScore();
- var _loc2_ = undefined;
- switch(this.difficulty)
- {
- case 1:
- _loc2_ = "easy";
- break;
- case 2:
- _loc2_ = "normal";
- break;
- case 3:
- _loc2_ = "hard";
- }
- if(!this.username || this.scoresent == 1 || _loc4_ < 0)
- {
- return false;
- }
- var _loc3_ = "http://endgameradio.com/sendscore.php?username=" + this.username + "&game=1&mode=" + this.playmode + "-" + _loc2_ + "&score=" + _loc4_ + "&user=" + this.userid + "&scoretype=";
- this.clip.loadVariables(_loc3_);
- this.scoresent = 1;
- return true;
- }
- function GetFinalScore()
- {
- var _loc2_ = undefined;
- _loc2_ = this.score;
- return _loc2_;
- }
- function End(result)
- {
- this.timemode = 3;
- Key.removeListener(this.keylistener);
- for(var _loc5_ in this.callback)
- {
- if(_loc5_ != "pointfade")
- {
- delete this.callback[_loc5_];
- }
- }
- var _loc4_ = undefined;
- switch(result)
- {
- case "win":
- _loc4_ = "*Ding* Grats! ^_^\nYou get 150% of your\nscore for completing";
- var _loc6_ = this.score;
- this.score = Math.floor(this.score * 1.5);
- this.Score(this.score - _loc6_);
- break;
- case "time":
- _loc4_ = "OH NOES!\nYou ran out of time O.o";
- break;
- case "quit":
- _loc4_ = ":(";
- break;
- case "fail":
- _loc4_ = "OH NOES!\nInstant Death mode means you lose. T.T";
- break;
- case "flaw":
- _loc4_ = "OH NOES!\nToo many flaws.\nThe Gods are not pleased...";
- }
- _root.backblocks._alpha = 0;
- var _loc3_ = _root.attachMovie("Dialog","dialog",10000);
- if(this.sitemode == 0)
- {
- _loc3_.submit._visible = false;
- _loc3_.entry._visible = false;
- }
- else
- {
- _loc3_.msg.text = "";
- _loc3_.msg._visible = false;
- }
- _loc3_._x = 270;
- _loc3_._y = 300;
- _loc3_.text.text = _loc4_;
- _loc3_.score.text = this.GetFinalScore();
- _loc3_.entry.name.text = this.username;
- }
- function Clean()
- {
- var _loc2_ = 0;
- while(_loc2_ < this.pieces.length)
- {
- this.pieces[_loc2_].Destroy();
- delete this.pieces[_loc2_];
- _loc2_ = _loc2_ + 1;
- }
- this.flawpiece.Destroy();
- this.flawpieceinv.Destroy();
- _loc2_ = 0;
- while(_loc2_ < this.bgm.length)
- {
- this.bgm[_loc2_].Stop();
- _loc2_ = _loc2_ + 1;
- }
- }
- function GetTimeLeft()
- {
- var _loc2_ = this.GetTimeUsed();
- _loc2_ = this.timelimit - _loc2_;
- return _loc2_;
- }
- function GetTimeUsed()
- {
- var _loc2_ = new Date();
- var _loc4_ = Math.floor(_loc2_.getTime() / 1000);
- var _loc3_ = _loc4_ - this.starttime;
- return _loc3_;
- }
- function Tick()
- {
- var _loc2_ = "--tick:";
- for(var _loc3_ in this.callback)
- {
- this.callback[_loc3_].call(this);
- _loc2_ += _loc3_ + ",";
- }
- }
- function Turn()
- {
- while(this.mutexpiece == true)
- {
- }
- this.mutexpiece = true;
- if(this.active.y + 1 == this.ground[this.active.x])
- {
- this.Land();
- }
- else
- {
- this.active.AddPosition(0,1);
- }
- this.mutexpiece = false;
- _root.whiteout._alpha = 0;
- this.turn = this.turn + 1;
- }
- function Land()
- {
- if(this.timemode >= 2)
- {
- return undefined;
- }
- this.active.SetPosition(-1,this.ground[this.active.x] - 1);
- this.ground[this.active.x] = this.active.y;
- var _loc4_ = 0;
- if(this.active.y < 1)
- {
- var _loc6_ = _root.array_search(this.freecols,this.active.x);
- this.freecols.splice(_loc6_,1);
- if(this.freecols.length == 0)
- {
- _loc4_ = 1;
- }
- }
- this.stack[this.active.x].push(this.active);
- this.order.push(this.active);
- var _loc3_ = this.landscore;
- this.Score(_loc3_);
- if(this.active.y < 4)
- {
- this.Score(_loc3_ * ((4 - this.active.y - 1) * 0.5 + 1) - _loc3_,"combo");
- }
- if(this.combo > 0)
- {
- this.Score(_loc3_ * ((this.combo - 1) * 0.5 + 1) - _loc3_,"combo");
- }
- this.combo = this.combo + 1;
- _root.textcombo.text = this.combo;
- var _loc5_ = this.Match();
- if(!_loc5_.match)
- {
- this.Fix(_loc5_);
- this.SoundEffect("PieceFlaw");
- }
- else
- {
- this.SoundEffect("PiecePlace");
- }
- if(_loc4_)
- {
- return this.End("win");
- }
- this.active = this.nextpiece;
- this.nextpiece = this.AddPiece();
- this.nextpiece.NextPiece();
- this.active.Begin();
- }
- function Fix(con)
- {
- var _loc4_ = undefined;
- var _loc5_ = undefined;
- var _loc7_ = 0;
- if(this.playmode == "sudden")
- {
- return this.End("fail");
- }
- var _loc8_ = this.active.GetLocalSec(0);
- var _loc3_ = 0;
- while(_loc3_ < 4)
- {
- _loc4_ = this.active.GetLocalSec(_loc3_);
- if(con.res[_loc3_] == false)
- {
- if(con.adj[_loc3_] == 0)
- {
- _loc5_ = 0;
- }
- else
- {
- _loc5_ = this.compliments[con.adj[_loc3_].GetLocalValue(this.opposites[_loc3_])];
- }
- this.flawpiece.LoadSec(_loc4_,_loc5_);
- this.flawpieceinv.LoadSec(_loc4_,this.active.GetLocalValue(_loc3_));
- this.active.LoadSec(_loc4_,_loc5_);
- this.countflaws = this.countflaws + 1;
- _root.textflaws.text = this.allowedflaws - this.countflaws;
- _loc7_ += this.flawscore;
- if(this.allowedflaws == this.countflaws)
- {
- return this.End("flaw");
- }
- }
- else
- {
- this.flawpiece.LoadSec(_loc4_,-1);
- this.flawpieceinv.LoadSec(_loc4_,-1);
- }
- _loc3_ = _loc3_ + 1;
- }
- if(_loc7_)
- {
- this.flawpiece.SetPosition(this.active.x,this.active.y);
- this.flawpiece.SetRotation(- _loc8_);
- this.flawpiece.Flaw();
- this.flawpiece.Show();
- this.flawpieceinv.SetPosition(this.active.x,this.active.y);
- this.flawpieceinv.SetRotation(- _loc8_);
- this.flawpieceinv.Flaw();
- this.flawpieceinv.Show();
- this.callback.flawflash = this.TickFlawFlash;
- this.Score(_loc7_,"flaw");
- this.combo = 0;
- _root.textcombo.text = this.combo;
- }
- }
- function Match()
- {
- var _loc3_ = new JigConnection();
- _loc3_.adj = this.active.GetAdjacent();
- _loc3_.res = new Array();
- _loc3_.match = true;
- var _loc2_ = 0;
- while(_loc2_ < 4)
- {
- var _loc5_ = "testing " + this.active.OrientName(_loc2_) + ": ";
- var _loc6_ = this.active.GetLocalValue(_loc2_);
- if(_loc3_.adj[_loc2_] == undefined)
- {
- var _loc4_ = undefined;
- switch(_loc2_)
- {
- case 0:
- _loc4_ = this.active.y == 0;
- break;
- case 1:
- _loc4_ = this.active.x == this.width - 1;
- break;
- case 3:
- _loc4_ = this.active.x == 0;
- break;
- case 2:
- _loc4_ = this.active.y == this.height - 1;
- }
- if(_loc4_)
- {
- _loc3_.res[_loc2_] = _loc6_ == 0;
- _loc3_.adj[_loc2_] = 0;
- _loc5_ += "wall (" + _loc6_ + "==0)";
- }
- else
- {
- _loc3_.res[_loc2_] = true;
- _loc5_ += "nothing";
- }
- }
- else
- {
- _loc3_.res[_loc2_] = this.compliments[_loc6_] == _loc3_.adj[_loc2_].GetLocalValue(this.opposites[_loc2_]);
- _loc5_ += "piece (" + _loc6_ + "<=>" + _loc3_.adj[_loc2_].GetLocalValue(this.opposites[_loc2_]) + ")";
- }
- if(_loc3_.res[_loc2_] == false)
- {
- _loc3_.match = false;
- }
- _loc2_ = _loc2_ + 1;
- }
- return _loc3_;
- }
- function Mark(arr)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.mark.length)
- {
- this.pieces[this.mark[_loc2_]].Unmark();
- _loc2_ = _loc2_ + 1;
- }
- this.mark = new Array();
- _loc2_ = 0;
- while(_loc2_ < arr.length)
- {
- this.pieces[arr[_loc2_]].Mark();
- this.mark.push(arr[_loc2_]);
- _loc2_ = _loc2_ + 1;
- }
- }
- function Score(n, type)
- {
- n = Math.floor(n);
- if(n == 0)
- {
- return undefined;
- }
- this.score += n;
- _root.textscore.text = this.score;
- var _loc3_ = this.pointsclip.attachMovie("points",this.pointsi,this.pointsi);
- _loc3_._x = this.active.clip._x;
- _loc3_._y = this.active.clip._y;
- if(n > 0)
- {
- _loc3_.text.text = "+" + n;
- }
- else
- {
- _loc3_.text.text = n;
- }
- switch(type)
- {
- case "flaw":
- _loc3_.text.textColor = 16751001;
- _loc3_._y += 20;
- break;
- case "combo":
- _loc3_.text.textColor = 10066431;
- _loc3_._y -= 20;
- }
- this.pointsclist[this.pointsi] = _loc3_;
- this.pointsi = this.pointsi + 1;
- this.callback.pointfade = this.TickPointFade;
- }
- function SoundEffect(v)
- {
- this.soundfx.stop();
- this.soundfx.attachSound(v);
- this.soundfx.setVolume(100);
- this.soundfx.start();
- }
- function UseClaw(v)
- {
- if(this.active.GetLocalValue(3) == v)
- {
- return undefined;
- }
- this.callback.claw = this.TickClawOut;
- this.clawqueue = v;
- switch(v)
- {
- case 0:
- this.countleveler = this.countleveler + 1;
- _root.textleveler.text = this.countleveler;
- this.Score(this.levelerscore);
- this.SoundEffect("ToolLeveler");
- break;
- case 1:
- this.countsculptor = this.countsculptor + 1;
- _root.textsculptor.text = this.countsculptor;
- this.Score(this.sculptorscore);
- this.SoundEffect("ToolSculptor");
- break;
- case 2:
- this.countdrill = this.countdrill + 1;
- _root.textdrill.text = this.countdrill;
- this.Score(this.drillscore);
- this.SoundEffect("ToolDrill");
- }
- }
- function KeyRight()
- {
- while(this.mutexpiece == true)
- {
- }
- this.mutexpiece = true;
- if(this.active.x < 7)
- {
- var _loc2_ = this.active.GetAdjacentRight();
- if(_loc2_ == undefined)
- {
- this.active.AddPosition(1,0);
- }
- }
- this.mutexpiece = false;
- }
- function KeyLeft()
- {
- while(this.mutexpiece == true)
- {
- }
- this.mutexpiece = true;
- if(this.active.x > 0)
- {
- var _loc2_ = this.active.GetAdjacentLeft();
- if(_loc2_ == undefined)
- {
- this.active.AddPosition(-1,0);
- }
- }
- this.mutexpiece = false;
- }
- function KeyUp()
- {
- this.active.AddRotation(-1);
- }
- function KeyDown()
- {
- this.active.AddRotation(1);
- }
- function KeyDrop()
- {
- this.Land();
- }
- function KeyAccel()
- {
- if(this.timemode != 3)
- {
- this.timemode = 1;
- }
- }
- function KeyUnAccel()
- {
- this.accel = 0;
- if(this.timemode != 3)
- {
- this.timemode = 0;
- }
- }
- function KeyHold()
- {
- if(this.timemode != 3)
- {
- this.timemode = 2;
- if(this.soundmode == 0)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.bgm.length)
- {
- this.bgm[_loc2_].SetVolume(15);
- _loc2_ = _loc2_ + 1;
- }
- this.soundmode = 1;
- this.callback.whiteout = this.TickWhiteOut;
- this.sound.attachSound("HoldStart");
- this.sound.setVolume(100);
- this.sound.start();
- this.sound.onSoundComplete = function()
- {
- if(this.GetTimeLeft() < 60)
- {
- this.attachSound("HoldLoopAlt");
- }
- else
- {
- this.attachSound("HoldLoop");
- }
- this.start();
- this.onSoundComplete = function()
- {
- this.start();
- };
- };
- }
- }
- }
- function KeyUnHold()
- {
- if(this.timemode == 3)
- {
- return undefined;
- }
- this.timemode = 0;
- _root.whiteout._alpha = 0;
- if(this.soundmode == 1)
- {
- this.soundmode = 0;
- this.callback.mixout = this.TickMixOut;
- }
- }
- function KeyDrill()
- {
- if(this.playmode != "bare" && this.playmode != "sculptor" && this.playmode != "leveler")
- {
- this.UseClaw(2);
- }
- }
- function KeySculptor()
- {
- if(this.playmode != "bare" && this.playmode != "driller" && this.playmode != "leveler")
- {
- this.UseClaw(1);
- }
- }
- function KeyLeveler()
- {
- if(this.playmode != "bare" && this.playmode != "sculptor" && this.playmode != "driller")
- {
- this.UseClaw(0);
- }
- }
- function TickClawOut()
- {
- var _loc2_ = undefined;
- var _loc4_ = -20;
- _loc2_ = this.clawclip._x + this.clawspeed * (this.active.x + 1) * 0.5;
- var _loc3_ = this.active.GlobalX(this.active.x);
- if(_loc2_ >= _loc3_ + _loc4_)
- {
- _loc2_ = _loc3_ + _loc4_;
- this.callback.claw = this.TickClawIn;
- this.active.LoadSec(this.active.GetLocalSec(3),this.clawqueue);
- }
- this.clawclip._x = _loc2_;
- }
- function TickClawIn()
- {
- var _loc2_ = undefined;
- _loc2_ = this.clawclip._x - this.clawspeed * (this.active.x + 1) * 0.5;
- if(_loc2_ <= 66)
- {
- _loc2_ = 66;
- delete this.callback.claw;
- }
- this.clawclip._x = _loc2_;
- }
- function TickTimer()
- {
- var _loc3_ = undefined;
- if(this.playmode == "speed")
- {
- _loc3_ = this.GetTimeLeft();
- if(_loc3_ <= 0)
- {
- this.End("time");
- }
- }
- else
- {
- _loc3_ = this.GetTimeUsed();
- }
- var _loc4_ = Math.floor(_loc3_ / 60) + ":" + _root.str_lpad(_loc3_ % 60);
- _root.texttime.text = _loc4_;
- }
- function TickMixOut()
- {
- var _loc3_ = 3;
- var _loc4_ = this.sound.getVolume() - _loc3_;
- if(_loc4_ < 0)
- {
- _loc4_ = 0;
- }
- this.sound.setVolume(_loc4_);
- var _loc5_ = "mixout: ";
- var _loc2_ = 0;
- while(_loc2_ <= 100)
- {
- if(_loc2_ <= _loc4_)
- {
- _loc5_ += "*";
- }
- _loc2_ += _loc3_;
- }
- if(_loc4_ == 0)
- {
- delete this.callback.mixout;
- this.sound.stop();
- }
- _loc2_ = 0;
- while(_loc2_ < this.bgm.length)
- {
- this.bgm[_loc2_].AddVolume(_loc3_);
- _loc2_ = _loc2_ + 1;
- }
- }
- function TickPointFade()
- {
- var _loc2_ = 0;
- for(var _loc3_ in this.pointsclist)
- {
- this.pointsclist[_loc3_].text._y -= 5;
- if(this.pointsclist[_loc3_].text._y < -20)
- {
- this.pointsclist[_loc3_].text._alpha -= 5;
- }
- if(this.pointsclist[_loc3_].text._y < -120)
- {
- this.pointsclist[_loc3_].removeMovieClip();
- delete this.pointsclist[_loc3_];
- }
- _loc2_ = _loc2_ + 1;
- }
- if(_loc2_ == 0)
- {
- delete this.callback.pointfade;
- }
- }
- function TickFrame()
- {
- switch(this.timemode)
- {
- case 0:
- this.holdmeter += this.holdregen;
- if(this.holdmeter > this.holdmax)
- {
- this.holdmeter = this.holdmax;
- }
- this.holdclip._width = this.holdmeter / this.holdmax * 171;
- break;
- case 1:
- this.accel += this.accelrate;
- if(this.accel > this.accelmax)
- {
- this.accel = this.accelmax;
- }
- break;
- case 2:
- this.holdmeter -= 1;
- if(this.holdmeter <= 0)
- {
- this.holdmeter = 0;
- this.KeyUnHold();
- }
- this.holdclip._width = this.holdmeter / this.holdmax * 171;
- }
- }
- function TickSmoothFall()
- {
- if(this.timemode < 2)
- {
- this.tickcount += 1 + this.accel;
- var _loc2_ = this.tickcount % this.speedbase;
- if(_loc2_ < this.lastmod)
- {
- this.Turn();
- }
- else
- {
- var _loc3_ = this.active.GlobalY(this.active.y) + Math.floor(_loc2_ / this.speedbase * this.psizey);
- this.active.clip._y = _loc3_;
- this.clawclip._y = _loc3_;
- }
- this.lastmod = _loc2_;
- }
- }
- function TickFlawFlash()
- {
- this.flawtimetick = this.flawtimetick + 1;
- if(this.flawtimetick >= this.flawtime)
- {
- this.flawtimetick = 0;
- this.flawcount = this.flawcount + 1;
- this.flawpiece.Toggle();
- this.flawpieceinv.Toggle();
- if(this.flawcount >= this.flawlimit)
- {
- this.flawpiece.Hide();
- this.flawpieceinv.Hide();
- this.flawcount = 0;
- delete this.callback.flawflash;
- }
- }
- }
- function TickWhiteOut()
- {
- if(this.soundmode == 0)
- {
- _root.whiteout._alpha = 0;
- delete this.callback.whiteout;
- }
- var _loc3_ = _root.whiteout._alpha;
- _loc3_ += 9;
- if(_loc3_ > 100)
- {
- _loc3_ = 30;
- delete this.callback.whiteout;
- }
- _root.whiteout._alpha = _loc3_;
- }
- function TickJumpFall()
- {
- if(this.timemode < 2)
- {
- this.tickcount += 1;
- var _loc2_ = this.tickcount % this.speedbase;
- if(_loc2_ < this.lastmod)
- {
- this.Turn();
- var _loc3_ = this.active.GlobalY(this.active.y) + Math.floor(_loc2_ / this.speedbase * this.psizey);
- this.active.clip._y = _loc3_;
- this.clawclip._y = _loc3_;
- }
- this.lastmod = _loc2_;
- }
- }
- }
-