Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- move.anim = function (battle, args, effObj) {
- var attacker = args[0];
- var defender = args[1];
- for (var i in effObj) {
- var potato = effObj[i];
- if (potato.type === 'effect') {
- var matlab1 = {x: 0, y: 0, z: 0, opaque: 0, scale: 0, time: 0};
- for (var j in matlab1) {
- var stuff1 = potato.stuff1
- if (!stuff1[j] && stuff1[j] !== 0) {
- delete matlab1[j];
- } else {
- if (j.length !== 1) {
- matlab1[j] = stuff1[j]
- } else {
- if (stuff1[j].length === 1) {
- matlab1[j] = stuff1[j];
- } else {
- if (stuff1[j][0] === 'a') {
- matlab1[j] = attacker[j] + stuff1[j][1];
- } else if (stuff1[j][0] === 'd') {
- matlab1[j] = defender[j] + stuff1[j][1];
- } else if (stuff1[j][0] === 'ab' && j === 'z') {
- matlab1[j] = attacker.behind(stuff1[j][1]);
- } else if (stuff1[j][0] === 'db' && j === 'z') {
- matlab1[j] = defender.behind(stuff1[j][1]);
- } else if (stuff1[j][0] === 'al' && j === 'x') {
- matlab1[j] = attacker.leftof(stuff1[j][1]);
- } else if (stuff1[j][0] === 'dl' && j === 'x') {
- matlab1[j] = defender.leftof(stuff1[j][1]);
- } else if (stuff1[j][0] === 'avg') {
- matlab1[j] = parseInt((attacker[j]+defender[j])/2) + stuff1[j][1];
- }
- }
- }
- }
- };
- var matlab2 = {x: 0, y: 0, z: 0, opaque: 0, scale: 0, time: 0};
- for (var k in matlab2) {
- var stuff2 = potato.stuff2
- if (!stuff2[j] && stuff2[j] !== 0) {
- delete matlab2[j];
- } else {
- if (j.length !== 1) {
- matlab2[j] = stuff2[j]
- } else {
- if (stuff2[j].length === 1) {
- matlab2[j] = stuff2[j];
- } else {
- if (stuff2[j][0] === 'a') {
- matlab2[j] = attacker[j] + stuff2[j][1];
- } else if (stuff2[j][0] === 'd') {
- matlab2[j] = defender[j] + stuff2[j][1];
- } else if (stuff2[j][0] === 'ab' && j === 'z') {
- matlab2[j] = attacker.behind(stuff2[j][1]);
- } else if (stuff2[j][0] === 'db' && j === 'z') {
- matlab2[j] = defender.behind(stuff2[j][1]);
- } else if (stuff2[j][0] === 'al' && j === 'x') {
- matlab2[j] = attacker.leftof(stuff2[j][1]);
- } else if (stuff2[j][0] === 'dl' && j === 'x') {
- matlab2[j] = defender.leftof(stuff2[j][1]);
- } else if (stuff2[j][0] === 'avg') {
- matlab2[j] = parseInt((attacker[j]+defender[j])/2) + stuff2[j][1];
- }
- }
- }
- }
- };
- if (potato.type === 'attacker.sp') potato.type = attacker.sp;
- if (potato.transitions.length === 1) {
- battle.showEffect(potato.type, matlab, potato.transitions[0]);
- } else if (potato.transitions.length > 1) { //caps at 2 things
- battle.showEffect(potato.type, matlab, potato.transitions[0], potato.transitions[1]);
- } else {
- battle.showEffect(potato.type, matlab);
- }
- } else if (potato.type === 'anim') {
- var matlab = {x: 0, y: 0, z: 0, opaque: 0, scale: 0, time: 0};
- for (var j in matlab) {
- var stuff = potato.stuff
- if (!stuff[j] && stuff[j] !== 0) {
- delete matlab[j];
- } else {
- if (j.length !== 1) {
- matlab[j] = stuff[j]
- } else {
- if (stuff[j].length === 1) {
- matlab[j] = stuff[j];
- } else {
- if (stuff[j][0] === 'a') {
- matlab[j] = attacker[j] + stuff[j][1];
- } else if (stuff[j][0] === 'd') {
- matlab[j] = defender[j] + stuff[j][1];
- } else if (stuff[j][0] === 'ab' && j === 'z') {
- matlab[j] = attacker.behind(stuff[j][1]);
- } else if (stuff[j][0] === 'db' && j === 'z') {
- matlab[j] = defender.behind(stuff[j][1]);
- } else if (stuff[j][0] === 'al' && j === 'x') {
- matlab[j] = attacker.leftof(stuff[j][1]);
- } else if (stuff[j][0] === 'dl' && j === 'x') {
- matlab[j] = defender.leftof(stuff[j][1]);
- } else if (stuff[j][0] === 'avg') {
- matlab[j] = parseInt((attacker[j]+defender[j])/2) + stuff[j][1];
- }
- }
- }
- }
- };
- if (potato.target === 'a') {
- if (potato.transitions.length === 1) {
- attacker.anim(matlab, potato.transitions[0]);
- } else if (potato.transitions.length > 1) { //caps at 2 things
- attacker.anim(matlab, potato.transitions[0], potato.transitions[1]);
- } else {
- attacker.anim(matlab);
- }
- } else if (potato.target === 'd') {
- if (potato.transitions.length === 1) {
- defender.anim(matlab, potato.transitions[0]);
- } else if (potato.transitions.length > 1) { //caps at 2 things
- defender.anim(matlab, potato.transitions[0], potato.transitions[1]);
- } else {
- defender.anim(matlab);
- }
- }
- } else if (potato.type === 'delay') {
- if (potato.target === 'a') {
- attacker.delay(potato.time);
- } else if (potato.target === 'd') {
- defender.delay(potato.time);
- }
- } else if (potato.type === 'wait') {
- battle.activityWait(potato.time);
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment