home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Estrategia / coffeetycoon_Demo.swf / scripts / frame_2 / DoAction_16.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  9.0 KB  |  151 lines

  1. function levelup_addmods(mod)
  2. {
  3.    var itemname = _root.get_itemroot(mod[gc_itemvar]);
  4.    var item = eval(itemname);
  5.    var dim1 = eval(_root.get_itemdims(mod[gc_itemvar],1));
  6.    var d2 = _root.get_itemdims(mod[gc_itemvar],2);
  7.    var dim2 = d2 != "-1" ? eval(d2) : -1;
  8.    var evar = _root.get_itemvalue(item,dim1,dim2);
  9.    var val;
  10.    val = _root.get_itemval(mod[gc_itemval],mod[gc_itemtype]);
  11.    evar = _root.operate_item(evar,val,mod[gc_itemop]);
  12.    item = _root.set_itemvalue(itemname,dim1,dim2,evar);
  13. }
  14. function levelup_now()
  15. {
  16.    var _loc2_ = _root;
  17.    var _loc1_ = undefined;
  18.    var _loc3_ = _loc2_.get_poplevel();
  19.    _loc2_.leveluplevel = _loc2_.antlevel + 1;
  20.    _loc2_.leveluptxt = "";
  21.    _loc1_ = 0;
  22.    while(_loc1_ < _loc2_.levelup_mods[_loc3_].length)
  23.    {
  24.       trace("levelup_now: mod[" + _loc1_ + "]");
  25.       _loc2_.leveluptxt += _loc2_.levelup_text[_loc3_][_loc1_] + "\r\n";
  26.       _loc2_.levelup_addmods(_loc2_.levelup_mods[_loc3_][_loc1_]);
  27.       _loc1_ = _loc1_ + 1;
  28.    }
  29. }
  30. var gc_itemvar = 0;
  31. var gc_itemop = 1;
  32. var gc_itemval = 2;
  33. var gc_itemtype = 3;
  34. var gc_itemrestock = 4;
  35. var levelup_mods = new Array();
  36. _root.levelup_mods[0] = new Array();
  37. _root.levelup_mods[0][0] = new Array("_root.bogus","+","0","int",false);
  38. _root.levelup_mods[0][1] = new Array("_root.bogus","+","0","int",false);
  39. _root.levelup_mods[1] = new Array();
  40. _root.levelup_mods[1][0] = new Array("_root.antstats[gc_stored]","+","50","int",false);
  41. _root.levelup_mods[1][1] = new Array("_root.antstats[gc_pop]","+","5","int",false);
  42. _root.levelup_mods[2] = new Array();
  43. _root.levelup_mods[2][0] = new Array("_root.antstats[gc_stored]","+","100","int",false);
  44. _root.levelup_mods[2][1] = new Array("_root.antstats[gc_nest]","+","1","int",false);
  45. _root.levelup_mods[3] = new Array();
  46. _root.levelup_mods[3][0] = new Array("_root.antstats[gc_stored]","+","250","int",false);
  47. _root.levelup_mods[3][1] = new Array("_root.antstats[gc_nest]","+","1","int",false);
  48. _root.levelup_mods[4] = new Array();
  49. _root.levelup_mods[4][0] = new Array("_root.antstats[gc_stored]","+","500","int",false);
  50. _root.levelup_mods[4][1] = new Array("_root.antstats[gc_pop]","+","50","int",false);
  51. _root.levelup_mods[5] = new Array();
  52. _root.levelup_mods[5][0] = new Array("_root.antstats[gc_pop]","+","100","int",false);
  53. _root.levelup_mods[5][1] = new Array("_root.antstats[gc_nest]","+","3","int",false);
  54. _root.levelup_mods[6] = new Array();
  55. _root.levelup_mods[6][0] = new Array("_root.antstats[gc_stored]","+","2500","int",false);
  56. _root.levelup_mods[6][1] = new Array("_root.antstats[gc_pop]","+","250","int",false);
  57. _root.levelup_mods[7] = new Array();
  58. _root.levelup_mods[7][0] = new Array("_root.antstats[gc_stored]","+","5000","int",false);
  59. _root.levelup_mods[7][1] = new Array("_root.antstats[gc_pop]","+","500","int",false);
  60. _root.levelup_mods[8] = new Array();
  61. _root.levelup_mods[8][0] = new Array("_root.antstats[gc_pop]","+","1000","int",false);
  62. _root.levelup_mods[8][1] = new Array("_root.antstats[gc_nest]","+","10","int",false);
  63. _root.levelup_mods[9] = new Array();
  64. _root.levelup_mods[9][0] = new Array("_root.antstats[gc_stored]","+","10000","int",false);
  65. _root.levelup_mods[9][1] = new Array("_root.antstats[gc_pop]","+","2500","int",false);
  66. _root.levelup_mods[10] = new Array();
  67. _root.levelup_mods[10][0] = new Array("_root.antstats[gc_stored]","+","25000","int",false);
  68. _root.levelup_mods[10][1] = new Array("_root.antstats[gc_pop]","+","2500","int",false);
  69. _root.levelup_mods[11] = new Array();
  70. _root.levelup_mods[11][0] = new Array("_root.antstats[gc_pop]","+","5000","int",false);
  71. _root.levelup_mods[11][1] = new Array("_root.antstats[gc_nest]","+","50","int",false);
  72. _root.levelup_mods[12] = new Array();
  73. _root.levelup_mods[12][0] = new Array("_root.antstats[gc_stored]","+","100000","int",false);
  74. _root.levelup_mods[12][1] = new Array("_root.antstats[gc_pop]","+","10000","int",false);
  75. _root.levelup_mods[13] = new Array();
  76. _root.levelup_mods[13][0] = new Array("_root.antstats[gc_stored]","+","250000","int",false);
  77. _root.levelup_mods[13][1] = new Array("_root.antstats[gc_nest]","+","250","int",false);
  78. _root.levelup_mods[14] = new Array();
  79. _root.levelup_mods[14][0] = new Array("_root.antstats[gc_stored]","+","500000","int",false);
  80. _root.levelup_mods[14][1] = new Array("_root.antstats[gc_pop]","+","50000","int",false);
  81. _root.levelup_mods[15] = new Array();
  82. _root.levelup_mods[15][0] = new Array("_root.antstats[gc_pop]","+","0","int",false);
  83. _root.levelup_mods[15][1] = new Array("_root.antstats[gc_money]","+","0","int",false);
  84. _root.levelup_mods[16] = new Array();
  85. _root.levelup_mods[16][0] = new Array("_root.antstats[gc_stored]","+","0","int",false);
  86. _root.levelup_mods[16][1] = new Array("_root.antstats[gc_money]","+","0","int",false);
  87. _root.levelup_mods[17] = new Array();
  88. _root.levelup_mods[17][0] = new Array("_root.antstats[gc_nest]","+","0","int",false);
  89. _root.levelup_mods[17][1] = new Array("_root.antstats[gc_money]","+","0","int",false);
  90. _root.levelup_mods[18] = new Array();
  91. _root.levelup_mods[18][0] = new Array("_root.antstats[gc_pop]","+","0","int",false);
  92. _root.levelup_mods[18][1] = new Array("_root.antstats[gc_money]","+","0","int",false);
  93. var levelup_text = new Array();
  94. _root.levelup_text[0] = new Array();
  95. _root.levelup_text[0][0] = "000";
  96. _root.levelup_text[0][1] = "000";
  97. _root.levelup_text[1] = new Array();
  98. _root.levelup_text[1][0] = "Great job! You are off to a good start. Pour yourself a coffee, you\'re doing great! New recipes and store upgrades are available.";
  99. _root.levelup_text[1][1] = "You\'ve earned a bonus! +50 Money and +5 Customers";
  100. _root.levelup_text[2] = new Array();
  101. _root.levelup_text[2][0] = "Great job! New recipes and store upgrades are available.";
  102. _root.levelup_text[2][1] = "You\'ve earned a bonus! +100 Money and +1 Store";
  103. _root.levelup_text[3] = new Array();
  104. _root.levelup_text[3][0] = "Great job! New recipes and store upgrades are available.";
  105. _root.levelup_text[3][1] = "You\'ve earned a bonus! +250 Money and +1 Store";
  106. _root.levelup_text[4] = new Array();
  107. _root.levelup_text[4][0] = "Great job! New recipes and store upgrades are available.";
  108. _root.levelup_text[4][1] = "You\'ve earned a bonus! +500 Money and +50 Customers";
  109. _root.levelup_text[5] = new Array();
  110. _root.levelup_text[5][0] = "Great job! New recipes and store upgrades are available.";
  111. _root.levelup_text[5][1] = "You\'ve earned a bonus! +100 Customers and +3 Stores ";
  112. _root.levelup_text[6] = new Array();
  113. _root.levelup_text[6][0] = "Great job! New recipes and store upgrades are available.";
  114. _root.levelup_text[6][1] = "You\'ve earned a bonus! +2500 Money and +250 Customers";
  115. _root.levelup_text[7] = new Array();
  116. _root.levelup_text[7][0] = "Great job! New recipes and store upgrades are available.";
  117. _root.levelup_text[7][1] = "You\'ve earned a bonus! +5000 Money and +500 Customers";
  118. _root.levelup_text[8] = new Array();
  119. _root.levelup_text[8][0] = "Great job! New recipes and store upgrades are available.";
  120. _root.levelup_text[8][1] = "You\'ve earned a bonus! +1000 Customers and +10 Stores";
  121. _root.levelup_text[9] = new Array();
  122. _root.levelup_text[9][0] = "Great job! New recipes and store upgrades are available.";
  123. _root.levelup_text[9][1] = "You\'ve earned a bonus! +10000 Money and +2500 Customers";
  124. _root.levelup_text[10] = new Array();
  125. _root.levelup_text[10][0] = "Great job! New recipes and store upgrades are available.";
  126. _root.levelup_text[10][1] = "You\'ve earned a bonus! +25000 Money and +2500 Customers";
  127. _root.levelup_text[11] = new Array();
  128. _root.levelup_text[11][0] = "Great job! New recipes and store upgrades are available.";
  129. _root.levelup_text[11][1] = "You\'ve earned a bonus! +5000 Customers and +50 Stores";
  130. _root.levelup_text[12] = new Array();
  131. _root.levelup_text[12][0] = "Great job! New recipes and store upgrades are available.";
  132. _root.levelup_text[12][1] = "You\'ve earned a bonus! +100000 Money and +10000 Customers";
  133. _root.levelup_text[13] = new Array();
  134. _root.levelup_text[13][0] = "Great job! New recipes and store upgrades are available.";
  135. _root.levelup_text[13][1] = "You\'ve earned a bonus! +250000 Money and +250 Stores";
  136. _root.levelup_text[14] = new Array();
  137. _root.levelup_text[14][0] = "Great job! New recipes and store upgrades are available.";
  138. _root.levelup_text[14][1] = "You\'ve earned a bonus! +500000 Money and +50000 Customers";
  139. _root.levelup_text[15] = new Array();
  140. _root.levelup_text[15][0] = "Congratulations! You\'ve reached 1,000,000 Customers!";
  141. _root.levelup_text[15][1] = "";
  142. _root.levelup_text[16] = new Array();
  143. _root.levelup_text[16][0] = "Great job! New recipes and store upgrades are available.";
  144. _root.levelup_text[16][1] = "You\'ve earned a bonus! +5000000 Money and +75000 Customers";
  145. _root.levelup_text[17] = new Array();
  146. _root.levelup_text[17][0] = "Great job! New recipes and store upgrades are available.";
  147. _root.levelup_text[17][1] = "You\'ve earned a bonus! +50000 Stores and +100000 Customers";
  148. _root.levelup_text[18] = new Array();
  149. _root.levelup_text[18][0] = "Great job! New recipes and store upgrades are available.";
  150. _root.levelup_text[18][1] = "You\'ve earned a bonus! +1000000 Employees and +250000 Customers";
  151.