功勋兑换黄金赦令
帮某沙漏做的,原计划五一之前搞好,然而失败了。
我认为问题不在于代码。
以我分析,需要改动的地方有三处。
my.AllEquipment
initHuoDong处push黄金赦令
1 package my 2 { 3 public class AllEquipment 4 { 5 6 7 private var rudeEquipment:Array; 8 9 private var normalEquipment:Array; 10 11 private var excellentEquipment:Array; 12 13 private var wellEquipment:Array; 14 15 private var otherEquipment:Array; 16 17 private var hdEquipment:Array; 18 19 private var hd2Equipment:Array; 20 21 private var rudeClothes:MyEquipObj; 22 23 private var rudeStick:MyEquipObj; 24 25 private var rudeCassock:MyEquipObj; 26 27 private var rudeStaff:MyEquipObj; 28 29 private var normalClothes:MyEquipObj; 30 31 private var normalStick:MyEquipObj; 32 33 private var normalCassock:MyEquipObj; 34 35 private var normalStaff:MyEquipObj; 36 37 private var excellentClothes:MyEquipObj; 38 39 private var excellentStick:MyEquipObj; 40 41 private var excellentCassock:MyEquipObj; 42 43 private var excellentStaff:MyEquipObj; 44 45 private var wellClothes:MyEquipObj; 46 47 private var wellStick:MyEquipObj; 48 49 private var wellCassock:MyEquipObj; 50 51 private var wellStaff:MyEquipObj; 52 53 private var otherEquip1:MyEquipObj; 54 55 private var otherEquip2:MyEquipObj; 56 57 private var otherEquip3:MyEquipObj; 58 59 private var otherEquip4:MyEquipObj; 60 61 private var otherEquip5:MyEquipObj; 62 63 private var otherEquip6:MyEquipObj; 64 65 private var otherEquip7:MyEquipObj; 66 67 private var otherEquip8:MyEquipObj; 68 69 private var otherEquip9:MyEquipObj; 70 71 private var otherEquip10:MyEquipObj; 72 73 private var otherEquip11:MyEquipObj; 74 75 private var otherEquip12:MyEquipObj; 76 77 private var otherEquip13:MyEquipObj; 78 79 private var otherEquip14:MyEquipObj; 80 81 private var otherEquip15:MyEquipObj; 82 83 private var otherEquip16:MyEquipObj; 84 85 private var otherEquip17:MyEquipObj; 86 87 private var otherEquip18:MyEquipObj; 88 89 private var otherEquip19:MyEquipObj; 90 91 private var otherEquip20:MyEquipObj; 92 93 private var otherEquip21:MyEquipObj; 94 95 private var otherEquip22:MyEquipObj; 96 97 private var huodong1:MyEquipObj; 98 99 private var huodong2:MyEquipObj; 100 101 private var huodong3:MyEquipObj; 102 103 private var etj1:MyEquipObj; 104 105 private var etj2:MyEquipObj; 106 107 private var etj3:MyEquipObj; 108 109 private var etj4:MyEquipObj; 110 111 public function AllEquipment() 112 { 113 this.rudeEquipment = new Array(); 114 this.normalEquipment = new Array(); 115 this.excellentEquipment = new Array(); 116 this.wellEquipment = new Array(); 117 this.otherEquipment = new Array(); 118 this.hdEquipment = new Array(); 119 this.hd2Equipment = new Array(); 120 super(); 121 } 122 123 public function newMyEquipObj() : void 124 { 125 this.rudeEquipment = null; 126 this.normalEquipment = null; 127 this.excellentEquipment = null; 128 this.wellEquipment = null; 129 this.otherEquipment = null; 130 this.hdEquipment = null; 131 this.rudeEquipment = new Array(); 132 this.normalEquipment = new Array(); 133 this.excellentEquipment = new Array(); 134 this.wellEquipment = new Array(); 135 this.otherEquipment = new Array(); 136 this.hdEquipment = new Array(); 137 this.rudeClothes = new MyEquipObj(2,"粗糙的行者服","ccxzf","zbfj","战士","粗 糙","0xCCCCCC",0,0,0,1,0,0,0,0,{},""); 138 this.rudeStick = new MyEquipObj(2,"粗糙的行者棍","ccxzg","zbwq","战士","粗 糙","0xCCCCCC",0,0,2 + Math.round(Math.random() * 3),0,0,0,0,0,{},""); 139 this.rudeCassock = new MyEquipObj(2,"粗糙的袈裟","ccjs","zbfj","法师","粗 糙","0xCCCCCC",0,0,0,1,0,0,0,0,{},""); 140 this.rudeStaff = new MyEquipObj(2,"粗糙的松木杖","ccsmz","zbwq","法师","粗 糙","0xCCCCCC",0,0,2 + Math.round(Math.random() * 3),0,0,0,0,0,{},""); 141 this.normalClothes = new MyEquipObj(2,"普通的行者服","ptxzf","zbfj","战士","普 通","0xFFFFFF",20 + Math.round(Math.random() * 20),20 + Math.round(Math.random() * 20),0,3,0,0,0,0,{},""); 142 this.normalStick = new MyEquipObj(2,"普通的行者棍","ptxzg","zbwq","战士","普 通","0xFFFFFF",0,0,5 + Math.round(Math.random() * 10),0,0,0,0,0,{},""); 143 this.normalCassock = new MyEquipObj(2,"普通的袈裟","ptjs","zbfj","法师","普 通","0xFFFFFF",20 + Math.round(Math.random() * 20),20 + Math.round(Math.random() * 20),0,2,0,0,0,0,{},""); 144 this.normalStaff = new MyEquipObj(2,"普通的松木杖","ptsmz","zbwq","法师","普 通","0xFFFFFF",0,0,8 + Math.round(Math.random() * 8),0,0,0,0,0,{},""); 145 this.excellentClothes = new MyEquipObj(3,"优秀的行者服","yxxzf","zbfj","战士","优 秀","0x00FF00",40 + Math.round(Math.random() * 30),40 + Math.round(Math.random() * 30),0,6,0,0,0,0,{},""); 146 this.excellentStick = new MyEquipObj(3,"优秀的行者棍","yxxzg","zbwq","战士","优 秀","0x00FF00",0,0,10 + Math.round(Math.random() * 10),0,0,0,0,0,{},""); 147 this.excellentCassock = new MyEquipObj(3,"优秀的袈裟","yxjs","zbfj","法师","优 秀","0x00FF00",40 + Math.round(Math.random() * 30),40 + Math.round(Math.random() * 30),0,3,0,0,0,0,{},""); 148 this.excellentStaff = new MyEquipObj(3,"优秀的松木杖","yxsmz","zbwq","法师","优 秀","0x00FF00",0,0,16 + Math.round(Math.random() * 16),0,0,0,0,0,{},""); 149 this.wellClothes = new MyEquipObj(3,"精良的行者服","jlxzf","zbfj","战士","精 良","0x0000FF",70 + Math.round(Math.random() * 40),70 + Math.round(Math.random() * 40),0,9,0,0,0,0,{},""); 150 this.wellStick = new MyEquipObj(3,"精良的行者棍","jlxzg","zbwq","战士","精 良","0x0000FF",0,0,20 + Math.round(Math.random() * 10),0,0,0,0,0,{},""); 151 this.wellCassock = new MyEquipObj(3,"精良的袈裟","jljs","zbfj","法师","精 良","0x0000FF",70 + Math.round(Math.random() * 40),70 + Math.round(Math.random() * 40),0,5,0,0,0,0,{},""); 152 this.wellStaff = new MyEquipObj(3,"精良的松木杖","jlsmz","zbwq","法师","精 良","0x0000FF",0,0,32 + Math.round(Math.random() * 16),0,0,0,0,0,{},""); 153 this.otherEquip1 = new MyEquipObj(1,"地煞灵戒","dslj","zbsp","","优 秀","0x00FF00",0,0,15,4,0.03,0.03,0,0,{},"聚万物之灵气,佩戴后来去通风,聆其音,知其前后,万物皆明"); 154 this.otherEquip6 = new MyEquipObj(4,"地煞猿甲","dsyj","zbfj","战士","优 秀","0x00FF00",80 + Math.round(Math.random() * 30),50 + Math.round(Math.random() * 20),0,4,0,0,0,0,{},"据说是通臂猿猴的战甲,染上了无法褪去的血迹和被遗忘的记忆"); 155 this.otherEquip7 = new MyEquipObj(4,"地煞权杖","dsqz","zbwq","法师","优 秀","0x00FF00",0,100,20,0,0,0,0,0,{},"权杖捆绑着上古遗骸,蕴藏驱神之力,挥舞间,兴云起雾,电闪雷鸣"); 156 this.otherEquip2 = new MyEquipObj(1,"天煞骨链","tsgl","zbsp","","精 良","0x0000FF",0,0,30 + Math.round(Math.random() * 10),10 + Math.round(Math.random() * 2),0.03,0.03,0,0,{},"用无数妖怪的骸骨熔炼的项链,月圆时会发出百兽的悲鸣"); 157 this.otherEquip8 = new MyEquipObj(6,"天煞羽袍","tsyp","zbfj","法师","精 良","0x0000FF",130 + Math.round(Math.random() * 20),260 + Math.round(Math.random() * 40),0,4,0,0,0,0,{},"传说由鲲鹏羽毛编织成的法袍,藏有无限的法力,穿上后腾云驾雾,翱翔云端"); 158 this.otherEquip9 = new MyEquipObj(4,"天煞月戟","tsyj","zbwq","战士","精 良","0x0000FF",0,0,50,0,0.03,0,0,0,{},"由月石经三味真火精炼而成,闪耀着黄金般的光芒,此光堪比皓月之明"); 159 this.otherEquip10 = new MyEquipObj(1,"血海妖壳","xhyk","zbsp","","精 良","0x0000FF",200 + Math.round(Math.random() * 30),0,0,20,0,0,2,0,{},"在血池里浸泡数载而出,坚如磐石,固若金汤"); 160 this.otherEquip11 = new MyEquipObj(6,"血海邪皇","xhxh","zbwq","法师","史 诗","0x660099",0,660,120,0,0,0,0,2,{},"吸取了血海里无数鲜血和冤魂妖化而成,诡异的妖杖散发着死亡的气息"); 161 this.otherEquip12 = new MyEquipObj(6,"血海魔甲","xhmj","zbfj","战士","史 诗","0x660099",0,0,80,-10,0.05,0.05,-2,0,{},"聚集了无数怨魂的怨气,闪烁着胆寒的光芒,给人撕心裂肺的绝望"); 162 this.otherEquip3 = new MyEquipObj(1,"七星守护","qxsh","zbsp","","史 诗","0x660099",0,0,60,12,0.05,0.05,2,2,{},"天枢、天璇、天玑、天权、玉衡、开阳、摇光,七星北斗,七星守护"); 163 this.otherEquip13 = new MyEquipObj(1,"锦襕袈裟","zljs","zbfj","法师","史 诗","0x660099",300,660,0,14,0,0,0,5,{},""); 164 this.otherEquip14 = new MyEquipObj(7,"九环禅杖","jhcz","zbwq","法师","传 说","0xFF6600",450,900,170,0,0,0,0,5,{},"渡劫之日,三界俱灭,九环圣光,万物复苏"); 165 this.otherEquip15 = new MyEquipObj(1,"大圣战铠","dszk","zbfj","战士","史 诗","0x660099",500,330,0,30,0,0.1,0,0,{},""); 166 this.otherEquip16 = new MyEquipObj(5,"如意金箍棒","ryjgb","zbwq","战士","传 说","0xFF6600",0,0,120,0,0.15,0,0,0,{},"东海龙宫之定海神针,一万三千五百斤,浩劫之际,元归齐天"); 167 this.otherEquip17 = new MyEquipObj(5,"白虎杖","bhz","zbwq","法师","精 良","0x0000FF",0,130,44,0,0,0,0,2,{},"传说由白虎的肋骨打制的法杖,施法时其疾如风,只见白虎之影"); 168 this.otherEquip18 = new MyEquipObj(6,"青龙刀","qld","zbwq","战士","精 良","0x0000FF",0,0,30,0,0.03,0,2,0,{},"传说由青龙的尖牙锻铸的大刀,挥舞间雷声贯耳,宛如青龙咆哮"); 169 this.otherEquip19 = new MyEquipObj(5,"玄武甲","xwj","zbfj","战士","精 良","0x0000FF",200,0,0,10,0,0,2,0,{},"传说由玄武的鳞片打造的战甲,装备后坚不可摧,呈现玄武防御之势"); 170 this.otherEquip20 = new MyEquipObj(5,"麒麟袍","qlp","zbfj","法师","精 良","0x0000FF",130,260,0,4,0,0,0,2,{},"传说由麒麟的绒毛编织的法袍,法力源源不绝,犹如麒麟附体"); 171 this.otherEquip5 = new MyEquipObj(1,"朱雀戒","zqj","zbsp","","精 良","0x0000FF",0,0,20,10,0.02,0.02,1,1,{},"传说由朱雀的内丹熔炼的戒指,佩戴完攻击大增,朱雀般华丽"); 172 this.otherEquip4 = new MyEquipObj(1,"家传手镯","jcsz","zbsp","","优 秀","0x00FF00",0,0,15,4,0,0,0,0,{},"看似普通的手镯,蕴藏有神秘的力量,只有凑齐家传装备才能释放出这股力量"); 173 this.otherEquip21 = new MyEquipObj(7,"家传宝剑","jcbj","zbwq","战士","优 秀","0x00FF00",0,0,15,0,0.03,0,0,0,{},"看似普通的宝剑,蕴藏有神秘的力量,只有凑齐家传装备才能释放出这股力量"); 174 this.otherEquip22 = new MyEquipObj(4,"家传衣裳","jcys","zbfj","法师","优 秀","0x00FF00",80,80,0,4,0,0,0,0,{},"看似普通的衣裳,蕴藏有神秘的力量,只有凑齐家传装备才能释放出这股力量"); 175 this.huodong1 = new MyEquipObj(1,"东海旗幡","dhqf","zbfb","","优 秀","0x00FF00",20 + Math.round(Math.random() * 80),20 + Math.round(Math.random() * 80),10 + Math.round(Math.random() * 30),0,0,0,0,0,{},""); 176 this.huodong2 = new MyEquipObj(1,"金钢琢","jgz","zbfb","","史 诗","0x660099",0,0,50 + Math.round(Math.random() * 30),0,0.02 + Number((Math.random() * 0.03).toFixed(2)),0,2 + Math.round(Math.random() * 3),0,{},""); 177 this.huodong3 = new MyEquipObj(1,"黄金赦令","hjsl","zbfb","","传说","0xFF6600",100,100,88,0,0.05,0.05,2,2,{},""); 178 this.rudeEquipment.push(this.rudeClothes,this.rudeStick,this.rudeCassock,this.rudeStaff); 179 this.normalEquipment.push(this.normalClothes,this.normalStick,this.normalCassock,this.normalStaff); 180 this.excellentEquipment.push(this.excellentClothes,this.excellentStick,this.excellentCassock,this.excellentStaff); 181 this.wellEquipment.push(this.wellClothes,this.wellStick,this.wellCassock,this.wellStaff); 182 var _loc1_:uint = 0; 183 while(_loc1_ < 22) 184 { 185 this.otherEquipment.push(this["otherEquip" + (_loc1_ + 1)]); 186 _loc1_++; 187 } 188 this.hdEquipment.push(this.huodong1,this.huodong2,this.huodong3); 189 } 190 191 public function findByName(param1:String) : MyEquipObj 192 { 193 var _loc2_:uint = this.rudeEquipment.length; 194 while(_loc2_-- > 0) 195 { 196 if(param1 == this.rudeEquipment[_loc2_].fillName) 197 { 198 return this.rudeEquipment[_loc2_]; 199 } 200 } 201 var _loc3_:uint = this.normalEquipment.length; 202 while(_loc3_-- > 0) 203 { 204 if(param1 == this.normalEquipment[_loc3_].fillName) 205 { 206 return this.normalEquipment[_loc3_]; 207 } 208 } 209 var _loc4_:uint = this.excellentEquipment.length; 210 while(_loc4_-- > 0) 211 { 212 if(param1 == this.excellentEquipment[_loc4_].fillName) 213 { 214 return this.excellentEquipment[_loc4_]; 215 } 216 } 217 var _loc5_:uint = this.wellEquipment.length; 218 while(_loc5_-- > 0) 219 { 220 if(param1 == this.wellEquipment[_loc5_].fillName) 221 { 222 return this.wellEquipment[_loc5_]; 223 } 224 } 225 var _loc6_:uint = this.otherEquipment.length; 226 while(_loc6_-- > 0) 227 { 228 if(param1 == this.otherEquipment[_loc6_].fillName) 229 { 230 return this.otherEquipment[_loc6_]; 231 } 232 } 233 var _loc7_:uint = this.hdEquipment.length; 234 while(_loc7_-- > 0) 235 { 236 if(param1 == this.hdEquipment[_loc7_].fillName) 237 { 238 return this.hdEquipment[_loc7_]; 239 } 240 } 241 var _loc8_:uint = this.hd2Equipment.length; 242 while(_loc8_-- > 0) 243 { 244 if(param1 == this.hd2Equipment[_loc8_].fillName) 245 { 246 return this.hd2Equipment[_loc8_]; 247 } 248 } 249 return null; 250 } 251 252 public function initHouDong(param1:uint) : void 253 { 254 this.hd2Equipment = null; 255 this.hd2Equipment = new Array(); 256 if(param1 < 7) 257 { 258 this.etj1 = new MyEquipObj(8,"童年的拨浪鼓","tndblg","zbwq","法师","传 说","0xFF6600",0,0,2 * param1 * (param1 - 1) + Math.round(Math.random() * 4 * param1),0,0,0,0,0,{},""); 259 this.etj2 = new MyEquipObj(8,"童年的冰糖葫芦","tndbthl","zbwq","战士","传 说","0xFF6600",0,0,2 * param1 * param1 - 5 * param1 + 3 + Math.round(Math.random() * (4 * param1 - 3)),0,0,0,0,0,{},""); 260 this.etj3 = new MyEquipObj(1,"招财铃铛","zcld","zbfb","","传 说","0xFF6600",(30 + Math.round(Math.random() * 20)) * param1,(30 + Math.round(Math.random() * 20)) * param1,0,0,0,0,0,0,{},""); 261 } 262 else 263 { 264 this.etj1 = new MyEquipObj(8,"童年的拨浪鼓","tndblg","zbwq","法师","传 说","0xFF6600",0,0,2 * param1 * (param1 - 1) + Math.round(Math.random() * 4 * param1),0,0,0,0,2 + Math.round(Math.random() * 4),{},""); 265 this.etj2 = new MyEquipObj(8,"童年的冰糖葫芦","tndbthl","zbwq","战士","传 说","0xFF6600",0,0,2 * param1 * param1 - 5 * param1 + 3 + Math.round(Math.random() * (4 * param1 - 3)),0,Number((0.03 + Math.random() * 0.07).toFixed(2)),0,0,0,{},""); 266 this.etj3 = new MyEquipObj(1,"招财铃铛","zcld","zbfb","","传 说","0xFF6600",(30 + Math.round(Math.random() * 20)) * param1,(30 + Math.round(Math.random() * 20)) * param1,0,0,0,0,2 + Math.round(Math.random() * 4),0,{},""); 267 } 268 this.etj4 = new MyEquipObj(1,"黄金赦令","hjsl","zbfb","","传说","0xFF6600",100,100,88,0,0.05,0.05,2,2,{},""); 269 this.hd2Equipment.push(this.etj1,this.etj2,this.etj3,this.etj4); 270 } 271 } 272 }
config.Congig
initData处push黄金赦令入sdList
1 package config 2 { 3 import PhysicsWorlds.PhysicsWorld; 4 import base.BaseHero; 5 import event.AEventDispatcher; 6 import export.FloorBg; 7 import export.GameInfo; 8 import export.GameSence; 9 import export.Infomation; 10 import flash.display.MovieClip; 11 import flash.display.Stage; 12 import flash.net.LocalConnection; 13 import flash.utils.Timer; 14 import my.AllEquipment; 15 import my.KeyBoardControl; 16 import my.ViewControllor; 17 import storage.MemoryClass; 18 import user.User; 19 20 public class Config 21 { 22 23 static var instance:Config; 24 25 public static var MODE1:int = 1; 26 27 public static var MODE2:int = 2; 28 29 public static var MODE3:int = 3; 30 31 32 public var memory:MemoryClass; 33 34 public var opening:Boolean; 35 36 public var eventManger:AEventDispatcher; 37 38 public var playNum:uint; 39 40 public var hero1:BaseHero; 41 42 public var hero2:BaseHero; 43 44 public var player1:User; 45 46 public var player2:User; 47 48 public var gameSence:GameSence; 49 50 public var gameInfo:GameInfo; 51 52 public var pWorld:PhysicsWorld; 53 54 public var bg1:FloorBg; 55 56 public var bg2:MovieClip; 57 58 public var stage:Stage; 59 60 public var isStopGame:Boolean; 61 62 public var vControllor:ViewControllor; 63 64 public var keyboardControl:KeyBoardControl; 65 66 public var allEquip:AllEquipment; 67 68 public var otherList:Array; 69 70 public var isHideDebug:Boolean; 71 72 public var isYourFather:Boolean; 73 74 public var curBigStage:uint = 1; 75 76 public var curBigLevel:uint = 1; 77 78 public var lc:LocalConnection; 79 80 public var playerName:String; 81 82 public var logInfo:Object; 83 84 public var isFirstLogin:Boolean; 85 86 public var loginAlert:MovieClip; 87 88 public var lastSubmitScore:int; 89 90 public var usernameHash:String = ""; 91 92 public var huodong61Flag:Boolean; 93 94 public var ts:Infomation; 95 96 public var num1:int = 1; 97 98 public var num2:int = 2; 99 100 public var num5:int = 3; 101 102 public var num7:int = 7; 103 104 public var num3:int = 3; 105 106 public var num6:int = 6; 107 108 public var num4:int = 4; 109 110 public var num8:int = 8; 111 112 public var num9:int = 9; 113 114 public var num0:int = 0; 115 116 public var curLevel:uint = 1; 117 118 public var curStage:uint = 4; 119 120 public var isLevelClear:Boolean; 121 122 public var maxMonsterPerScreen:int = 8; 123 124 public var gameMode:int; 125 126 public var saveIntervelCount:int; 127 128 public var saveTimer:Timer; 129 130 public var logInfoTimer:Timer; 131 132 public var sdList:Array; 133 134 public var curDate:String = ""; 135 136 public var MONSTER24_PER_DAY_TIMES:int = 1; 137 138 public var ZHUWEI_1_PER_DAY_TIMES:int = 1; 139 140 public var ZHUWEI_2_PER_DAY_TIMES:int = 1; 141 142 public var ZHUWEI_3_PER_DAY_TIMES:int = 1; 143 144 public var monster24Reward:int = 50; 145 146 public var cangetDHQF:Boolean; 147 148 public var cangetJGZ:Boolean; 149 150 public var gongxun:int = 0; 151 152 public var zhuwei_1_times:int = 0; 153 154 public var zhuwei_2_times:int = 0; 155 156 public var zhuwei_3_times:int = 0; 157 158 public var monster24RewardTimes:int = 0; 159 160 private var getTimeCb:Function; 161 162 public function Config() 163 { 164 this.eventManger = new AEventDispatcher(); 165 this.allEquip = new AllEquipment(); 166 this.otherList = new Array(); 167 this.ts = new Infomation(); 168 this.sdList = new Array(); 169 super(); 170 if(!instance) 171 { 172 instance = this; 173 this.initData(); 174 } 175 } 176 177 public static function getInstance() : Config 178 { 179 return instance; 180 } 181 182 public function initData() : void 183 { 184 this.hero1 = null; 185 this.hero2 = null; 186 this.player1 = new User(); 187 this.player1.controlPlayer = 0; 188 this.player2 = new User(); 189 this.player2.controlPlayer = 1; 190 this.curBigLevel = uint(1); 191 this.curBigStage = uint(1); 192 this.memory = new MemoryClass(); 193 this.gongxun = 0; 194 this.zhuwei_1_times = 0; 195 this.zhuwei_2_times = 0; 196 this.zhuwei_3_times = 0; 197 this.monster24RewardTimes = 0; 198 this.cangetDHQF = true; 199 this.cangetJGZ = true; 200 this.allEquip.initHouDong(10); 201 this.sdList.length = 0; 202 this.sdList.push(this.allEquip.findByName("tndbthl")); 203 this.sdList.push(this.allEquip.findByName("tndblg")); 204 this.sdList.push(this.allEquip.findByName("zcld")); 205 this.sdList.push(this.allEquip.findByName("hjsl")); 206 } 207 208 public function getGameTime(param1:*) : void 209 { 210 var _loc2_:Date = null; 211 trace("===获取时间==="); 212 this.getTimeCb = param1; 213 if(GMain.serviceHold) 214 { 215 GMain.serviceHold.getServerTime(); 216 } 217 else 218 { 219 _loc2_ = new Date(); 220 this.curDate = _loc2_.getFullYear() + "-" + (_loc2_.getMonth() + 1) + "-" + _loc2_.getDate(); 221 trace("单机 this.curDate:" + this.curDate); 222 this.getTimeCb(); 223 } 224 } 225 226 public function showFloatTip(param1:String) : void 227 { 228 var _loc2_:Infomation = new Infomation(); 229 _loc2_.setTxt(param1); 230 this.stage.addChild(_loc2_); 231 } 232 233 public function onGetServerTime(param1:*) : void 234 { 235 if(param1 == "") 236 { 237 this.ts.setTxt("获取时间失败!请刷新网页"); 238 this.stage.addChild(this.ts); 239 return; 240 } 241 var _loc2_:Array = param1.split(" "); 242 this.curDate = _loc2_[0]; 243 trace("联机 this.curDate:" + this.curDate); 244 if(this.getTimeCb) 245 { 246 this.getTimeCb(); 247 } 248 } 249 250 public function destroyGame() : void 251 { 252 this.otherList = []; 253 this.isLevelClear = false; 254 } 255 256 public function isFb() : Boolean 257 { 258 return this.curStage == 9 && this.curLevel == 1; 259 } 260 261 public function isFb1() : Boolean 262 { 263 return this.curStage == 9 && this.curLevel == 1; 264 } 265 266 public function getPlayerArray() : Array 267 { 268 var _loc1_:Array = []; 269 if(this.hero1) 270 { 271 _loc1_.push(this.hero1); 272 } 273 if(this.hero2) 274 { 275 _loc1_.push(this.hero2); 276 } 277 return _loc1_; 278 } 279 } 280 }
my.MyEquipObj
构造函数处设定兑换所需功勋
1 package my 2 { 3 import flash.net.URLLoader; 4 5 public class MyEquipObj 6 { 7 8 9 public var showid:uint = 1; 10 11 public var ename:String = ""; 12 13 public var fillName:String = ""; 14 15 public var type:String = ""; 16 17 public var user:String = ""; 18 19 public var quality:String = ""; 20 21 public var color; 22 23 public var ehp:int; 24 25 public var emp:int; 26 27 public var eatt:int; 28 29 public var edef:int; 30 31 public var emiss:Number; 32 33 public var ecrit:Number; 34 35 public var eahp:int; 36 37 public var eamp:int; 38 39 public var aStrengthen:Object; 40 41 public var etype:String; 42 43 public var instruction:String = ""; 44 45 public var isStrengthen:Boolean; 46 47 public var value:uint; 48 49 public var gongxun:uint; 50 51 private var saveObj:Object; 52 53 private var saveString:String = ""; 54 55 private var jObj; 56 57 private var urlLoader:URLLoader; 58 59 public function MyEquipObj(param1:uint = 0, param2:String = "", param3:String = "", param4:String = "", param5:String = "", param6:String = "", param7:* = null, param8:int = 0, param9:int = 0, param10:int = 0, param11:int = 0, param12:Number = 0.0, param13:Number = 0.0, param14:int = 0, param15:int = 0, param16:Object = null, param17:String = "") 60 { 61 this.saveObj = {}; 62 super(); 63 this.showid = param1; 64 this.ename = param2; 65 this.fillName = param3; 66 this.type = param4; 67 this.user = param5; 68 this.quality = param6; 69 this.color = param7; 70 this.ehp = param8; 71 this.emp = param9; 72 this.eatt = param10; 73 this.edef = param11; 74 this.ecrit = param12; 75 this.emiss = param13; 76 this.eahp = param14; 77 this.eamp = param15; 78 this.aStrengthen = param16; 79 this.instruction = param17; 80 this.trans(param4); 81 this.transValue(); 82 this.gongxun = uint(uint(0)); 83 if(this.fillName == "tndbthl") 84 { 85 this.gongxun = uint(uint(800)); 86 } 87 else if(this.fillName == "tndblg") 88 { 89 this.gongxun = uint(uint(800)); 90 } 91 else if(this.fillName == "zcld") 92 { 93 this.gongxun = uint(uint(400)); 94 } 95 else if(this.fillName == "hjsl") 96 { 97 this.gongxun = uint(uint(999)); 98 } 99 } 100 101 private function strengthenEquip() : void 102 { 103 } 104 105 private function requestData() : void 106 { 107 this.urlLoader = new URLLoader(); 108 this.urlLoader.dataFormat = URLLoaderDataFormat.TEXT; 109 this.urlLoader.addEventListener(Event.COMPLETE,this.completeHandler); 110 this.urlLoader.load(new URLRequest("http://save.api.4399.com/?ac=get_time")); 111 } 112 113 private function completeHandler(param1:*) : void 114 { 115 this.urlLoader.removeEventListener(Event.COMPLETE,this.completeHandler); 116 this.jObj = JSON.parse(this.urlLoader.data); 117 this.setInstruction(this.jObj["time"]); 118 } 119 120 public function getTimeAndSetInstruction() : void 121 { 122 this.requestData(); 123 } 124 125 public function setInstruction(param1:*) : void 126 { 127 if(this.instruction == "") 128 { 129 if(this.fillName == "dhqf") 130 { 131 this.instruction = "于" + param1 + "击败龙王获得此法宝"; 132 } 133 else if(this.fillName == "jgz") 134 { 135 this.instruction = "于" + param1 + "击败牛魔王获得此法宝"; 136 } 137 } 138 } 139 140 private function trans(param1:String) : void 141 { 142 switch(param1) 143 { 144 case "zbfj": 145 this.etype = "防具"; 146 break; 147 case "zbwq": 148 this.etype = "武器"; 149 break; 150 case "zbsp": 151 this.etype = "饰 品"; 152 break; 153 case "zbfb": 154 this.etype = "法 宝"; 155 } 156 } 157 158 private function transValue() : void 159 { 160 switch(this.quality) 161 { 162 case "粗 糙": 163 this.value = uint(uint(10)); 164 break; 165 case "普 通": 166 this.value = uint(uint(20)); 167 break; 168 case "优 秀": 169 this.value = uint(uint(40)); 170 break; 171 case "精 良": 172 this.value = uint(uint(80)); 173 break; 174 case "史 诗": 175 this.value = uint(uint(160)); 176 break; 177 case "传 说": 178 this.value = uint(uint(320)); 179 } 180 } 181 182 public function getEquipSaveObj() : String 183 { 184 this.saveString = this.showid + "|" + this.ename + "|" + this.fillName + "|" + this.type + "|" + this.user + "|" + this.quality + "|" + this.color + "|" + this.ehp + "|" + this.emp + "|" + this.eatt + "|" + this.edef + "|" + this.emiss + "|" + this.ecrit + "|" + this.eahp + "|" + this.eamp + "|" + this.etype + "|" + this.instruction + "|" + this.isStrengthen + "|" + this.value; 185 return this.saveString; 186 } 187 188 public function setEquipSaveObj(param1:String) : void 189 { 190 var _loc2_:Array = param1.split("|"); 191 this.showid = uint(uint(_loc2_[0])); 192 this.ename = _loc2_[1]; 193 this.fillName = _loc2_[2]; 194 this.type = _loc2_[3]; 195 this.user = _loc2_[4]; 196 this.quality = _loc2_[5]; 197 this.color = _loc2_[6]; 198 this.ehp = int(int(_loc2_[7])); 199 this.emp = int(int(_loc2_[8])); 200 this.eatt = int(int(_loc2_[9])); 201 this.edef = int(int(_loc2_[10])); 202 this.emiss = Number(Number(_loc2_[11])); 203 this.ecrit = Number(Number(_loc2_[12])); 204 this.eahp = int(int(_loc2_[13])); 205 this.eamp = int(int(_loc2_[14])); 206 this.etype = _loc2_[15]; 207 this.instruction = _loc2_[16]; 208 this.isStrengthen = Boolean(Boolean(_loc2_[17])); 209 this.value = uint(uint(_loc2_[18])); 210 } 211 212 public function setOldEquipSaveObj(param1:Object) : void 213 { 214 this.showid = uint(uint(param1.showid)); 215 this.ename = param1.ename; 216 this.fillName = param1.fillName; 217 this.type = param1.type; 218 this.user = param1.user; 219 this.quality = param1.quality; 220 this.color = param1.color; 221 this.ehp = int(int(param1.ehp)); 222 this.emp = int(int(param1.emp)); 223 this.eatt = int(int(param1.eatt)); 224 this.edef = int(int(param1.edef)); 225 this.emiss = Number(Number(param1.emiss)); 226 this.ecrit = Number(Number(param1.ecrit)); 227 this.eahp = int(int(param1.eahp)); 228 this.eamp = int(int(param1.eamp)); 229 this.aStrengthen = param1.aStrengthen; 230 this.etype = param1.etype; 231 this.instruction = param1.instruction; 232 this.isStrengthen = Boolean(Boolean(param1.isStrengthen)); 233 this.value = uint(uint(param1.value)); 234 } 235 } 236 }