Frame 1
function GetSavedData() {
var _local1 = SharedObject.getLocal("walfas_tenshipet", "/");
if (_local1.data.Achieves == null) {
_local1.data.Achieves = Achieves;
} else {
for (n in _local1.data.Achieves) {
Achieves[n] = _local1.data.Achieves[n];
}
}
if (_local1.data.Hits == null) {
_local1.data.Hits = Data.Hits;
} else {
Data.Hits = _local1.data.Hits;
}
if (_local1.data.HiCombo == null) {
_local1.data.HiCombo = Data.HiCombo;
} else {
Data.HiCombo = _local1.data.HiCombo;
}
if (_local1.data.HiHeight == null) {
_local1.data.HiHeight = Data.HiHeight;
} else {
Data.HiHeight = _local1.data.HiHeight;
}
_local1.flush();
}
function DataSync() {
var _local1 = SharedObject.getLocal("walfas_tenshipet", "/");
_local1.data.Achieves = Achieves;
_local1.data.Hits = Data.Hits;
_local1.data.HiCombo = Data.HiCombo;
_local1.data.HiHeight = Data.HiHeight;
_local1.flush();
}
function newAchieve(ID, aN, aD) {
Data[ID] = new Object();
AchArray.push(ID);
Achieves[ID] = false;
Data[ID].Name = aN;
Data[ID].Desc = aD;
}
function Hit() {
AI.tX = Tenshi._x;
Anim.Idle();
Data.Hits++;
if (Data.Hits > 1000) {
AchieveGet(7);
}
if ((Rock.Last == "Tenshi") && (!Rock.Ground)) {
AchieveGet(5);
}
Data.Combo++;
if ((Rock.Velocity > 70) && (!Achieves.SpeedBump)) {
AchieveGet(1);
}
if (Data.Combo > Data.HiCombo) {
Data.HiCombo = Data.Combo;
if ((Data.HiCombo > 5) && (!Achieves.ChainCombo)) {
AchieveGet(3);
}
}
if (Data.Combo > 1) {
Combo.D.text = Data.Combo + " Hit Combo!";
Combo.CD = 120;
Combo._alpha = 100;
}
if (Rock.Bounce > 9) {
AchieveGet(6);
}
if ((Rock.Ground && (Rock.Bounce == 0)) && (Rock.TopH > 350)) {
AchieveGet(8);
}
Rock.Bounce = 0;
DataSync();
}
function ApplyFriction(mc) {
mc.XMov = mc.XMov * Data.Friction;
if (Math.abs(mc.XMov) < 0.1) {
mc.XMov = 0;
}
}
function AchieveGet(ID) {
if (!Achieves[AchArray[ID]]) {
Achieves[AchArray[ID]] = true;
AchieveWindow["Ach" + ID].Chck.gotoAndStop(2);
Achieve.D.text = Data[AchArray[ID]].Name;
Achieve.CD = 120;
Achieve._alpha = 100;
DataSync();
}
}
function getRockHeight() {
return(Math.round(Math.abs(Data.Floor - (Rock._y + Data.RockSize))));
}
function RefreshInfo() {
InfoA.text = "Pet Tenshi";
Info.text = ("Rock Velocity: " + Math.round(Rock.Velocity)) + newline;
Info.text = Info.text + (("Rock Height: " + getRockHeight()) + newline);
Info.text = Info.text + (("Charge: " + Rock.Charge) + newline);
InfoB.text = ("Highest Throw: " + Data.HiHeight) + newline;
InfoB.text = InfoB.text + (("Hit Count: " + Data.Hits) + newline);
if (Data.HiCombo > 1) {
InfoB.text = InfoB.text + ("Highest Combo: " + Data.HiCombo);
}
}
Data = new Object();
Data.Friction = 0.9;
Data.Gravity = 1;
Data.Floor = 430;
Data.RockSize = 40;
Data.Combo = 0;
Data.Hits = 0;
Data.HiCombo = 0;
Data.HiHeight = 0;
Tenshi.gotoAndStop(1);
Combo._alpha = 0;
Combo.cacheAsBitmap = true;
Achieve._alpha = 0;
Achieve.cacheAsBitmap = true;
Pointer._visible = false;
_root.createEmptyMovieClip("AchieveWindow", 10);
_root.attachMovie("AchItem", "AchButton", 20);
AchButton.Chck._visible = false;
AchButton._x = 692;
AchButton._y = 463;
AchButton.onRelease = function () {
if (AchieveWindow._visible) {
AchieveWindow._visible = false;
ResetButton._visible = false;
} else {
AchieveWindow._visible = true;
ResetButton._visible = true;
}
};
_root.attachMovie("AchItem", "ResetButton", 23);
ResetButton.Chck._visible = false;
ResetButton._x = 692;
ResetButton._y = 50;
ResetButton.D.text = "Reset Data";
ResetButton._visible = false;
ResetButton.onRelease = function () {
Data.Hits = 0;
Data.HiHeight = 0;
Data.HiCombo = 0;
i = 0;
while (i < AchArray.length) {
Achieves[AchArray[i]] = false;
AchieveWindow["Ach" + i].Chck.gotoAndStop(1);
i++;
}
};
AchieveWindow.attachMovie("AchDesc", "Desc", 100);
AchieveWindow._visible = false;
Achieves = new Object();
AchArray = new Array();
newAchieve("MileHigh", "To the Heavens", "Achieve a high throw of over 4000.");
newAchieve("SpeedBump", "Critical Impact", "Hit Tenshi with a rock velocity of over 70.");
newAchieve("Squish", "Midgetizer", "Squish Tenshi.");
newAchieve("ChainCombo", "May I have another?", "Get a combo chain of over 5 hits.");
newAchieve("Balance", "Little Miss Perfect", "Balance the rock on Tenshi's head.");
newAchieve("HitSelf", "Self-served", "Have Tenshi hit herself with the rock without it hitting the ground first.");
newAchieve("Rebound", "Ultimate Rebound", "Hit Tenshi before the rock hits the ground after bouncing it off the walls 10 times.");
newAchieve("Bakusai", "Bakusai Tenketsu!!", "Hit Tenshi over 1000 times.");
newAchieve("BounceShot", "Sky's Spiritual Stone", "Bounce the rock off the ground, reach a height of over 350, then hit Tenshi before hitting a wall.");
newAchieve("MeteorCatch", "Meteor Catch", "Get a height of over 1000 with the rock and have Tenshi catch it on her head.");
newAchieve("PowerLevel", "It's over 9000!!", "Achieve a high throw of over 9000.");
AchieveWindow.Desc._y = 21 * (AchArray.length + 1);
GetSavedData();
i = 0;
while (i < AchArray.length) {
AchieveWindow.attachMovie("AchItem", "Ach" + i, i);
AchieveWindow["Ach" + i]._y = i * 21;
if (Achieves[AchArray[i]]) {
AchieveWindow["Ach" + i].Chck.gotoAndStop(2);
} else {
AchieveWindow["Ach" + i].Chck.gotoAndStop(1);
}
AchieveWindow["Ach" + i].ID = AchArray[i];
AchieveWindow["Ach" + i].D.text = Data[AchArray[i]].Name;
AchieveWindow["Ach" + i].onRollOver = function () {
AchieveWindow.Desc.D.text = Data[this.ID].Desc;
};
AchieveWindow["Ach" + i].onRollOut = function () {
AchieveWindow.Desc.D.text = "";
};
i++;
}
AchieveWindow._x = (Stage.width - AchieveWindow._width) / 2;
AchieveWindow._y = (Stage.height - AchieveWindow._height) / 2;
Tenshi._xscale = 50;
Tenshi._yscale = 50;
Tenshi.YMov = 0;
Tenshi.RMov = 0;
Tenshi.Speed = 2;
Rock._xscale = 50;
Rock._yscale = 50;
Rock.State = "Free";
Rock.Ground = true;
Rock.Bounce = 0;
Rock.XMov = 0;
Rock.YMov = 0;
Rock.CD = 0;
Rock.Charge = 0;
var BGS = ((Stage.width / 550) * 100);
BG._xscale = BGS;
BG._yscale = BGS;
AI = new Object();
AI.CD = 90;
AI.tX = Tenshi._x;
AI.Wander = function () {
Anim.Walk();
AI.tX = random(Stage.width - 50) + 25;
AI.CD = 300;
};
Anim = new Object();
Anim.Idle = function () {
if (Rock.State == "Held") {
Tenshi.gotoAndStop(6);
} else {
Tenshi.gotoAndStop(1);
}
};
Anim.Walk = function () {
if (Rock.State == "Held") {
Tenshi.gotoAndStop(7);
} else {
Tenshi.gotoAndStop(3);
}
};
Tenshi._y = Data.Floor;
Rock._y = Data.Floor - Data.RockSize;
Rock.onPress = function () {
this.startDrag(false, 0, 0, Stage.width, Data.Floor - Data.RockSize);
this.Charge = Math.round((this.Charge / 2) + this.Velocity);
this.State = "Drag";
this.Last = "Player";
this.oX = this._x;
this.oY = this._y;
};
Rock.onRelease = (Rock.onReleaseOutside = function () {
this.stopDrag();
this.State = "Free";
this.Ground = false;
this.TopH = 0;
this.XMov = ((this._x - this.oX) / 4) * ((this.Charge + 100) / 100);
this.YMov = ((this._y - this.oY) / 4) * ((this.Charge + 100) / 100);
});
KeyDown = false;
_root.onEnterFrame = function () {
if (Key.isDown(39)) {
if (!KeyDown) {
Rock.nextFrame();
Pointer.Rock.nextFrame();
KeyDown = true;
}
} else if (Key.isDown(37)) {
if (!KeyDown) {
Rock.prevFrame();
Pointer.Rock.prevFrame();
KeyDown = true;
}
} else {
KeyDown = false;
}
if (AI.CD > 0) {
AI.CD--;
} else if (Rock.State == "Held") {
AI.tX = Tenshi._x;
Tenshi.gotoAndStop(4);
AI.CD = 200;
} else {
AI.Wander();
}
if (Tenshi._x < AI.tX) {
Tenshi._xscale = 50;
if ((Tenshi._x + Tenshi.Speed) >= AI.tX) {
Tenshi._x = AI.tX;
Anim.Idle();
} else {
Tenshi._x = Tenshi._x + Tenshi.Speed;
}
} else if (Tenshi._x > AI.tX) {
Tenshi._xscale = -50;
if ((Tenshi._x - Tenshi.Speed) <= AI.tX) {
Tenshi._x = AI.tX;
Anim.Idle();
} else {
Tenshi._x = Tenshi._x - Tenshi.Speed;
}
}
if ((Math.abs(Rock._y - Tenshi._y) < 41) && (Math.abs(Rock._x - Tenshi._x) < 60)) {
if ((Rock.State == "Free") && (Rock.Velocity < 5)) {
if (((Tenshi._xscale > 0) && ((Rock._x - Tenshi._x) > 0)) || ((Tenshi._xscale < 0) && ((Rock._x - Tenshi._x) < 0))) {
if (Math.abs(Rock._x - Tenshi._x) > 30) {
AI.tX = Tenshi._x;
Tenshi.gotoAndStop(5);
} else if (Rock.Ground) {
Tenshi.gotoAndStop(2);
}
}
}
}
Rock.oX = Rock._x;
Rock.oY = Rock._y;
if (Rock.State == "Drag") {
if ((((_root._xmouse < 0) || (_root._ymouse < 0)) || (_root._xmouse > Stage.width)) || (_root._ymouse > Stage.height)) {
Rock.stopDrag();
Rock.State = "Free";
Rock.XMov = ((_root._xmouse - Rock.oX) / 4) * ((Rock.Charge + 100) / 100);
Rock.YMov = ((_root._ymouse - Rock.oY) / 4) * ((Rock.Charge + 100) / 100);
}
} else if (Rock.State == "Throw") {
if (Rock.CD > 0) {
Rock.CD--;
if (Rock.CD > 9) {
if (Tenshi._xscale > 0) {
Rock._x--;
} else {
Rock._x++;
}
} else if (Rock.CD < 6) {
if (Tenshi._xscale > 0) {
Rock._x = Rock._x + 10;
} else {
Rock._x = Rock._x - 10;
}
}
} else {
Rock.State = "Free";
Rock.Ground = false;
Rock.Last = "Tenshi";
Rock.XMov = Tenshi._xscale / 2;
Rock.YMov = -20;
}
} else if (Rock.State == "Balanced") {
Rock._x = Tenshi._x + Rock.tX;
Rock._y = Tenshi._y + Rock.tY;
} else if (Rock.State == "Held") {
Rock._x = Rock._x + (((Tenshi._x - (Tenshi._xscale / 2)) - Rock._x) / 5);
Rock._y = Rock._y + (((Tenshi._y - 20) - Rock._y) / 5);
} else {
if ((Rock._x + Rock.XMov) < 0) {
Rock.Bounce++;
Rock._x = 0;
Rock.XMov = Rock.XMov * -1;
} else if ((Rock._x + Rock.XMov) > Stage.width) {
Rock.Bounce++;
Rock._x = Stage.width;
Rock.XMov = Rock.XMov * -1;
} else {
Rock._x = Rock._x + Rock.XMov;
Rock._rotation = Rock._rotation + Rock.XMov;
}
if ((Rock._y + Rock.YMov) > (Data.Floor - Data.RockSize)) {
Rock.Ground = true;
Rock.Charge = 0;
Rock.TopH = 0;
Rock.Bounce = 0;
Rock._y = Data.Floor - Data.RockSize;
if (Rock.YMov > 5) {
Rock.YMov = Rock.YMov / -3;
} else {
Rock.YMov = 0;
}
ApplyFriction(Rock);
} else {
Rock._y = Rock._y + Rock.YMov;
if (Rock._y < (Data.RockSize * -1)) {
Pointer.Rock._rotation = Rock._rotation;
Pointer._x = Rock._x;
Pointer._visible = true;
} else {
Pointer._visible = false;
}
if (getRockHeight() > Rock.TopH) {
Rock.TopH = getRockHeight();
}
if (getRockHeight() > Data.HiHeight) {
Data.HiHeight = getRockHeight();
DataSync();
if (Data.HiHeight > 4000) {
AchieveGet(0);
if (Data.HiHeight > 9000) {
AchieveGet(10);
}
}
}
Rock.YMov = Rock.YMov + Data.Gravity;
}
if (Tenshi.hitTest(Rock._x + Rock.XMov, Rock._y + Rock.YMov, true)) {
if (((Tenshi.RMov < 0) && (Rock.XMov > 0)) && (Rock._x > Tenshi._x)) {
} else if (((Tenshi.RMov > 0) && (Rock.XMov < 0)) && (Rock._x < Tenshi._x)) {
} else {
if (Rock.Velocity > 5) {
Hit();
}
Tenshi.RMov = Rock.XMov;
Rock.XMov = Rock.XMov * (Data.Friction * -1);
}
if ((Rock._y < (Tenshi._y - 60)) && (Rock.YMov > 0)) {
if (Math.abs(Rock.XMov) < 5) {
Tenshi.YMov = Rock.YMov / 3;
Rock.YMov = Rock.YMov / -3;
Rock.XMov = Rock.XMov + ((Rock._x - Tenshi._x) / 10);
if (Math.abs(Rock.XMov) < 0.005) {
Rock.tX = Rock._x - Tenshi._x;
Rock.tY = Rock._y - Tenshi._y;
Rock.State = "Balanced";
AchieveGet(4);
if (Rock.TopH > 1000) {
AchieveGet(9);
}
}
}
}
}
}
var _local3 = Rock._x - Rock.oX;
var _local2 = Rock._y - Rock.oY;
Rock.Velocity = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if ((Tenshi._rotation + Tenshi.RMov) < -90) {
Tenshi._rotation = -90;
Tenshi.RMov = Tenshi.RMov / -3;
} else if ((Tenshi._rotation + Tenshi.RMov) > 90) {
Tenshi._rotation = 90;
Tenshi.RMov = Tenshi.RMov / -3;
} else {
Tenshi._rotation = Tenshi._rotation + Tenshi.RMov;
}
if ((Math.abs(Tenshi._rotation) < 1) && (Tenshi.RMov < 1)) {
Tenshi._rotation = 0;
Tenshi.RMov = 0;
} else if (Tenshi._rotation < 0) {
Tenshi.RMov++;
} else if (Tenshi._rotation > 0) {
Tenshi.RMov--;
}
Tenshi.RMov = Tenshi.RMov * Data.Friction;
if ((Tenshi._yscale - Tenshi.YMov) < 20) {
if (!Achieves.Squish) {
AchieveGet(2);
}
Tenshi._yscale = 20;
Tenshi.YMov = Tenshi.YMov / -3;
} else if ((Tenshi._yscale - Tenshi.YMov) > 80) {
Tenshi._yscale = 80;
Tenshi.YMov = Tenshi.YMov / -3;
} else {
Tenshi._yscale = Tenshi._yscale - Tenshi.YMov;
}
if ((Math.abs(50 - Tenshi._yscale) < 1) && (Tenshi.YMov < 1)) {
Tenshi._yscale = 50;
Tenshi.YMov = 0;
} else if (Tenshi._yscale < 50) {
Tenshi.YMov--;
} else if (Tenshi._yscale > 50) {
Tenshi.YMov++;
}
Tenshi.YMov = Tenshi.YMov * Data.Friction;
if (((Tenshi.RMov == 0) && (Tenshi.YMov == 0)) && (Data.Combo > 0)) {
Data.Combo = 0;
}
RefreshInfo();
if (Combo.CD > 0) {
Combo.CD--;
} else if (Combo._alpha > 0) {
Combo._alpha = Combo._alpha - 20;
}
if (Achieve.CD > 0) {
Achieve.CD--;
} else if (Achieve._alpha > 0) {
Achieve._alpha = Achieve._alpha - 20;
}
};
Rock.gotoAndStop(1);
Pointer.Rock.gotoAndStop(1);
Symbol 29 MovieClip Frame 14
_root.Rock.State = "Held";
Symbol 29 MovieClip Frame 26
_root.AI.Wander();
_root.Anim.Idle();
Symbol 31 MovieClip Frame 1
_root.Rock.State = "Throw";
_root.Rock.CD = 22;
Symbol 31 MovieClip Frame 40
_root.Anim.Idle();
Symbol 32 MovieClip Frame 17
_root.Rock.XMov = this._parent._xscale / 10;
Symbol 32 MovieClip Frame 44
this._parent.gotoAndStop(1);