/**
 * Created with JetBrains WebStorm.
 * User: ankit.goel
 * Date: 10/19/12
 * Time: 7:11 PM
 * To change this template use File | Settings | File Templates.
 */

ig.module(
    'game.entities.reward'
)
    .requires(
 'impact.entity'
)
    .defines(function () {
        Entityreward = ig.Entity.extend({
            size:{x:183, y:183},
            animSheet:new ig.AnimationSheet('media/Animation_reward_new2.png',183,183),
            zIndex:10000,
            init:function (x, y, settings) {
                this.parent(x, y, settings);
                this.addAnim('idle1', 0.1, [5]);

                this.addAnim('reward1', 0.2, [0,1,2,3,4,5], true);
                this.addAnim('idle2', 0.1, [9]);

                this.addAnim('reward2', 0.2, [6,7,8,9,10,11], true);
                this.addAnim('idle3', 0.1, [13]);

                this.addAnim('reward3', 0.2,[12,13,14,15,16,17], true);
                this.addAnim('idle4', 0.1,[17]);

                this.addAnim('reward4', 0.2, [18,19,20,21,22,23], true);
                this.addAnim('idle5', 0.1,[21]);

                this.addAnim('reward5', 0.2, [24,25,26,27,28,29], true);
                this.addAnim('idle6', 0.1,[25]);

                this.addAnim('reward6', 0.2, [30,31,32,33,34,35,36], true);

                this.addAnim('idle7', 0.1,[29]);
                this.addAnim('reward7', 0.2, [37,38,39,40,41,42,43], true);

                this.addAnim('idle8', 0.1,[33]);
                this.addAnim('reward8', 0.2, [44,45,46,47,48,49,50], true);

                this.addAnim('idle9', 0.1,[37]);
                this.addAnim('reward9', 0.2, [51,52,53,54,55,56,57], true);

                this.addAnim('idle10', 0.1, [41]);
                this.addAnim('reward10', 0.2, [58,59,60,61,62,63,64], true);

                this.addAnim('idle20', 0.1, [45]);
                this.addAnim('reward20', 0.3, [65,66,67,68,69,70,71], true);

                this.addAnim('idle30', 0.1, [49]);
                this.addAnim('reward30', 0.3,[72,73,74,75,76,77,78], true);

                this.addAnim('idle40', 0.1,[53]);
                this.addAnim('reward40', 0.2, [79,80,81,82,83,84,85], true);


                this.addAnim('idle50', 0.1,[57]);
                this.addAnim('reward50', 0.2, [86,87,88,89,90,91,92], true);


                this.addAnim('idle60', 0.1,[61]);
                this.addAnim('reward60', 0.2, [93,94,95,96,97,98,99], true);

                this.addAnim('idle70', 0.1,[65]);
                this.addAnim('reward70', 0.2, [100,101,102,103,104,105,106], true);

                this.addAnim('idle80', 0.1,[69]);
                this.addAnim('reward80', 0.2, [107,108,109,110,111,112,113], true);

                this.addAnim('idle90', 0.1,[73]);
                this.addAnim('reward90', 0.2, [114,115,116,117,118,119,120],true);
                this.vel.x=0;
                this.vel.y=0;
            },
            changeRewardAnimationSheet:function(number,obj){
         	var aa=parseInt(number/value_json.multiplication_factor);  
					switch (aa) {
                    case 1:
                        return obj.anims.reward1;
                        break;
                    case 2:
                        return obj.anims.reward2;
                        break;
                    case 3:
                        return obj.anims.reward3;
                        break;
                    case 4:
                        return obj.anims.reward4;
                        break;
                    case 5:
                        return obj.anims.reward5;
                        break;
                    case 6:
                        return obj.anims.reward6;
                        break;
                    case 7:
                        return obj.anims.reward7;
                        break;
                    case 8:
                        return obj.anims.reward8;
                        break;

                    case 9:
                        return obj.anims.reward9;
                        break;

                    case 10:case 11:  case 12:case 13:  case 14:case 15:  case 16:case 17:  case 18:case 19:
                    return obj.anims.reward10;
                    break;

                    case 20:  case 21:  case 22:case 23:  case 24:case 25:  case 26:case 27:  case 28:case 29:
                    return obj.anims.reward20;
                    break;

                    case 30:case 31:  case 32:case 33:  case 34:case 35:  case 36:case 37:  case 38:case 39:
                    return obj.anims.reward30;
                    break;

                    case 40:case 41:  case 42:case 43:  case 44:case 45:  case 46:case 47:  case 48:case 49:
                    return obj.anims.reward40;
                    break;

                    case 50:case 51:  case 52:case 53:  case 54:case 55:  case 56:case 57:  case 58:case 59:
                    return obj.anims.reward50;
                    break;

                    case 60:case 61:  case 62:case 63:  case 64:case 65:  case 66:case 67:  case 68:case 69:
                    return obj.anims.reward60;
                    break;

                    case 70:case 71:  case 72:case 73:  case 74:case 75:  case 76:case 77:  case 78:case 79:
                    return obj.anims.reward70;
                    break;

                    case 80:case 81:  case 82:case 83:  case 84:case 85:  case 86:case 87:  case 88:case 89:
                    return obj.anims.reward80;
                    break;

                    case 90:case 91:  case 92:case 93:  case 94:case 95:  case 96:case 97:  case 98:case 99:
                    return obj.anims.reward90;
                    break;

                    default:
                        return obj.anims.reward1;
                }
            },
            check:function (other) {
                return false;
            },
            update:function () {
                this.parent();
            }

        });
    });