Frame 1
function GetSavedData() {
var _local1 = SharedObject.getLocal("walfas_kaguya_table", "/");
if (_local1.data.Mem == null) {
Mem = new Object();
Mem.Count = 0;
Mem.StatPoints = 0;
Mem.Level = 1;
Mem.Damage = 0;
Mem.XP = 0;
Mem.XPNeeded = 500;
Mem.XPInc = 250;
_local1.data.Mem = Mem;
} else {
Mem = _local1.data.Mem;
}
if (_local1.data.Stats == null) {
Stats = new Array();
Stats.push(["Tactics", "Improves damage dealt to table.", 5]);
Stats.push(["RAGE!!!", "Increases maximum damage dealt to table.", 5]);
Stats.push(["NEETery", "Improves the amount of xp gained per damage.", 5]);
Stats.push(["Bossiness", "Does nothing, LIKE A BOSS.", 5]);
Stats.push(["Impatience", "Amount of points allocated per click.", 1]);
_local1.data.Stats = Stats;
} else {
Stats = _local1.data.Stats;
}
if (_local1.data.Mastery == null) {
Mastery = new Object();
Mastery.Level = 0;
Mastery.XP = 0;
Mastery.XPNeeded = 10;
_local1.data.Mastery = Mastery;
} else {
Mastery = _local1.data.Mastery;
}
_local1.flush();
}
function MasteryUP() {
while (Mastery.XP > Mastery.XPNeeded) {
Mastery.Level++;
Mastery.XP = Mastery.XP - Mastery.XPNeeded;
Mastery.XPNeeded = Mastery.XPNeeded * 2;
}
MasteryB.Bar._xscale = (Mastery.XP / Mastery.XPNeeded) * 100;
if (Mastery.Level >= 10) {
RebirthB._visible = true;
}
}
function ResetStats() {
Mem.StatPoints = 0;
Mem.Level = 1;
Mem.Damage = 0;
Mem.XP = 0;
Mem.XPNeeded = 500;
Mem.XPInc = 250;
Mem.Hardcore = 0;
Mastery.Level = 0;
Mastery.XP = 0;
Mastery.XPNeeded = 10;
Stats[0][2] = 5 + Mem.Rebirths;
Stats[1][2] = 5 + Mem.Rebirths;
Stats[2][2] = 5 + Mem.Rebirths;
Stats[3][2] = 5 + Mem.Rebirths;
Stats[4][2] = 1;
}
function DataSync() {
var _local1 = SharedObject.getLocal("walfas_kaguya_table", "/");
_local1.data.Mem = Mem;
_local1.data.Stats = Stats;
_local1.data.Mastery = Mastery;
_local1.flush();
}
function SkillCheck() {
if (Mem.Hardcore >= 5) {
Skill0._visible = true;
} else {
Skill0._visible = false;
}
if (Mem.Hardcore >= 20) {
Skill1._visible = true;
} else {
Skill1._visible = false;
}
if (Mem.Hardcore >= 50) {
Skill2._visible = true;
} else {
Skill2._visible = false;
}
}
function AddStat(sID) {
if (Mem.StatPoints < Stats[4][2]) {
Stats[sID][2] = Stats[sID][2] + Mem.StatPoints;
Mem.StatPoints = 0;
} else {
Mem.StatPoints = Mem.StatPoints - Stats[4][2];
Stats[sID][2] = Stats[sID][2] + Stats[4][2];
}
refreshStats();
}
function LevelUP() {
Mem.XP = Mem.XP - Mem.XPNeeded;
Mem.Level++;
Mem.XPNeeded = Mem.XPNeeded + Mem.XPInc;
Mem.StatPoints = Mem.StatPoints + (3 + Mem.Rebirths);
refreshStats();
}
function refreshInfo() {
Counter.showNum.text = Mem.Count + " Hits";
Counter.showNum.text = Counter.showNum.text + ("\nLevel " + Mem.Level);
Counter.showNum.text = Counter.showNum.text + ((((newline + Math.floor(Mem.XP)) + "/") + Mem.XPNeeded) + " XP");
Counter.showNum.text = Counter.showNum.text + ((newline + Mem.Damage) + " Total Damage");
Counter.showNum.text = Counter.showNum.text + ((newline + Mem.StatPoints) + " Stat Points");
}
function refreshStats() {
Counter.showStats.text = "";
i = 0;
while (i < Stats.length) {
Counter.showStats.text = Counter.showStats.text + (((Stats[i][0] + ": ") + Stats[i][2]) + newline);
if (Mem.StatPoints > 0) {
Counter["Stat" + i]._visible = true;
} else {
Counter["Stat" + i]._visible = false;
}
i++;
}
Counter.showStats.text = Counter.showStats.text + ("Hardcoreness: " + Mem.Hardcore);
Counter.showStats.text = Counter.showStats.text + ("\nMastery: " + Mastery.Level);
if (Mem.Rebirths > 0) {
Counter.showStats.text = Counter.showStats.text + ("\nRebirths: " + Mem.Rebirths);
}
}
this.createEmptyMovieClip("Counter", 20);
Counter.createTextField("showNum", 10, 0, 0, Stage.width, 100);
var tf = new TextFormat();
tf.align = "right";
tf.font = "WildWords";
tf.size = 18;
Counter.showNum.embedFonts = true;
Counter.showNum.selectable = false;
Counter.showNum.setNewTextFormat(tf);
Counter.createTextField("showStats", 20, 0, 100, Stage.width - 20, 150);
Counter.showStats.embedFonts = true;
Counter.showStats.selectable = false;
Counter.showStats.setNewTextFormat(tf);
Counter.createTextField("showTooltip", 30, 0, Stage.height - 20, Stage.width - 20, 20);
Counter.showTooltip.embedFonts = true;
Counter.showTooltip.selectable = false;
tf.align = "center";
Counter.showTooltip.setNewTextFormat(tf);
RebirthB._visible = false;
Hotkeys = new Object();
i = 0;
while (i < 5) {
Hotkeys["AddStat" + i] = new Object();
Hotkeys["AddStat" + i].ID = 49 + i;
Hotkeys["AddStat" + i].Pressed = false;
Hotkeys["AddStat" + i].sID = i;
Hotkeys["AddStat" + i].Action = function () {
if (Mem.StatPoints > 0) {
AddStat(this.sID);
refreshStats();
}
};
i++;
}
MasteryB.onRollOver = function () {
Counter.showTooltip.text = "Drop all XP into Mastery to gain Mastery levels!";
};
MasteryB.onRollOut = (MasteryB.onReleaseOutside = function () {
Counter.showTooltip.text = "";
});
MasteryB.onRelease = function () {
Mastery.XP = Mastery.XP + Mem.XP;
Mem.XP = 0;
refreshInfo();
MasteryUP();
};
RebirthB.onRollOver = function () {
Counter.showTooltip.text = "Resets all levels and stats. Increases stats per level by 1.";
};
RebirthB.onRollOut = (MasteryB.onReleaseOutside = function () {
Counter.showTooltip.text = "";
});
RebirthB.onRelease = function () {
Mem.Rebirths++;
Mem.StatPoints = 0;
Mem.Level = 1;
Mem.Damage = 0;
Mem.XP = 0;
Mem.XPNeeded = 500;
Mem.XPInc = 0;
Mastery.Level = 0;
Mastery.XP = 0;
Mastery.XPNeeded = 10;
Stats[0][2] = 5 + Mem.Rebirths;
Stats[1][2] = 5 + Mem.Rebirths;
Stats[2][2] = 5 + Mem.Rebirths;
Stats[3][2] = 5 + Mem.Rebirths;
Stats[4][2] = 1;
this.Bar._xscale = (Mastery.XP / Mastery.XPNeeded) * 100;
refreshInfo();
refreshStats();
RebirthB._visible = false;
};
GetSavedData();
MasteryB.Bar._xscale = (Mastery.XP / Mastery.XPNeeded) * 1;
if (Stats.length < 5) {
Stats.push(["Impatience", "Amount of points allocated per click.", 1]);
}
if (Mem.Rebirths == undefined) {
Mem.Rebirths = 0;
}
if (Mem.Hardcore == undefined) {
Mem.Hardcore = 0;
}
var i = 0;
while (i < 3) {
_root.attachMovie("Skill", "Skill" + i, 70 + i);
_root["Skill" + i]._x = (i * 60) + 220;
_root["Skill" + i]._y = 350;
_root["Skill" + i].Name.text = "";
_root["Skill" + i].gotoAndStop(i + 1);
_root["Skill" + i]._visible = false;
_root["Skill" + i].onRollOver = function () {
this.Name.text = this.ID;
Counter.showTooltip.text = this.ToolTip;
};
_root["Skill" + i].onRollOut = (_root["Skill" + i].onReleaseOutside = function () {
this.Name.text = "";
Counter.showTooltip.text = "";
});
i++;
}
Skill0.ID = "Meditation";
Skill0.ToolTip = "Returns all points spent on impatience.";
Skill0.onRelease = function () {
Mem.Hardcore = Mem.Hardcore - 5;
Mem.StatPoints = Mem.StatPoints + (Stats[4][2] - 1);
Stats[4][2] = 1;
SkillCheck();
refreshStats();
};
Skill1.ID = "Enlightenment";
Skill1.ToolTip = "Continually levels until xp is depleted.";
Skill1.onRelease = function () {
Mem.Hardcore = Mem.Hardcore - 20;
while (Mem.XP > Mem.XPNeeded) {
LevelUP();
}
SkillCheck();
};
Skill2.ID = "Master Slice";
Skill2.ToolTip = "Cuts amount of xp needed for mastery by 10%";
Skill2.onRelease = function () {
Mem.Hardcore = Mem.Hardcore - 50;
Mastery.XPNeeded = Mastery.XPNeeded - Math.floor(Mastery.XPNeeded / 10);
MasteryUP();
SkillCheck();
refreshStats();
};
SkillCheck();
i = 0;
while (i < (Stats.length + 1)) {
Counter.attachMovie("Add", "Stat" + i, 100 + i);
Counter["Stat" + i]._visible = false;
Counter["Stat" + i].ID = i;
Counter["Stat" + i]._x = Stage.width - 10;
Counter["Stat" + i]._y = (i * 18) + 110;
Counter["Stat" + i].onRollOver = function () {
Counter.showTooltip.text = Stats[this.ID][1];
};
Counter["Stat" + i].onRollOut = (Counter["Stat" + i].onReleaseOutside = function () {
Counter.showTooltip.text = "";
});
Counter["Stat" + i].onRelease = function () {
AddStat(this.ID);
DataSync();
};
i++;
}
Counter.Stat5._visible = true;
Counter.Stat5.onRollOver = function () {
Counter.showTooltip.text = "Increases table defense. Costs 10,000 Stat Points.";
};
Counter.Stat5.onRollOut = (Counter.Stat5.onReleaseOutside = function () {
Counter.showTooltip.text = "";
});
Counter.Stat5.onRelease = function () {
if (Mem.StatPoints >= 10000) {
Mem.StatPoints = Mem.StatPoints - 10000;
Mem.Hardcore++;
SkillCheck();
}
DataSync();
refreshStats();
};
Counter.onEnterFrame = function () {
for (n in Hotkeys) {
if (Key.isDown(Hotkeys[n].ID)) {
if (Hotkeys[n].Pressed == false) {
Hotkeys[n].Action();
Hotkeys[n].Pressed = true;
}
} else {
Hotkeys[n].Pressed = false;
}
}
if (kaguya._currentframe == 5) {
Mem.Count++;
var _local1 = (random(Stats[1][2] * 3) + Stats[0][2]) - (Mem.Hardcore * 1000);
if (_local1 < 1) {
_local1 = 1;
}
Mem.Damage = Mem.Damage + _local1;
Mem.XP = Mem.XP + (_local1 * (Stats[2][2] / (10 + Mem.Hardcore)));
if (Mem.XP > Mem.XPNeeded) {
LevelUP();
}
refreshInfo();
DataSync();
}
};
refreshStats();