Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
* text=auto
|
||||
*.py text eol=lf
|
||||
*.as text eol=lf
|
||||
*.java text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.csv text eol=lf
|
||||
*.cmd text eol=crlf
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
backend/local.db*
|
||||
backend/test-data/
|
||||
backend/__pycache__/
|
||||
backend/tmp*/
|
||||
backend/vendor/
|
||||
tools/ffdec_26.4.0.zip
|
||||
tools/jadx-headless-mcp-0.7.1-all.jar
|
||||
tools/jadx-headless-mcp.sha256
|
||||
analysis/build/
|
||||
analysis/verify_*/
|
||||
analysis/*.javap.txt
|
||||
analysis/*local-test*.p12
|
||||
analysis/*unsigned*.apk
|
||||
analysis/*aligned*.apk
|
||||
analysis/*.tmp
|
||||
local_state/
|
||||
ranch_assistant/__pycache__/
|
||||
ranch_assistant/tests/__pycache__/
|
||||
test-artifacts/
|
||||
|
||||
# Local accounts, diagnostics, databases and signing material.
|
||||
logs/
|
||||
.env
|
||||
.env.*
|
||||
*.jsonl
|
||||
*.har
|
||||
*.db
|
||||
*.db-*
|
||||
*.sqlite
|
||||
*.sqlite3
|
||||
*.p12
|
||||
*.pfx
|
||||
*.keystore
|
||||
*.jks
|
||||
*.pem
|
||||
*.key
|
||||
|
||||
# Supplied binaries, dependencies and generated packages/previews.
|
||||
*.apk
|
||||
*.zip
|
||||
*.jar
|
||||
*.class
|
||||
*.dex
|
||||
*.swf
|
||||
*.app
|
||||
*.png
|
||||
*.pyc
|
||||
*.pyo
|
||||
**/__pycache__/
|
||||
/tools/ffdec/
|
||||
/flashlib/
|
||||
|
||||
# Keep the canonical decompilation and focused audit evidence, not rebuilds.
|
||||
/analysis/*/
|
||||
!/analysis/as3/
|
||||
!/analysis/sdk_login/
|
||||
!/analysis/bytecode_audit/
|
||||
!/analysis/loader_audit/
|
||||
/analysis/device_*
|
||||
/analysis/*dump*.txt
|
||||
@@ -0,0 +1,18 @@
|
||||
# 牧羊人之心本地分析与 Qt 牧场辅助
|
||||
|
||||
双击 `Start_Ranch_Helper.cmd` 启动辅助。依赖与使用方法见
|
||||
[ranch_assistant/README.md](ranch_assistant/README.md)。
|
||||
|
||||
- `ranch_assistant/`:原生 PySide6 界面、登录会话、手动孵蛋规则、牧场管理及测试。
|
||||
- `analysis/`:接口清单、行为分析、原始反编译源码及部分审计证据。
|
||||
- `tools/`:本地资料提取、接口清单生成和历史分析工具。
|
||||
- `backend/`:早期的独立本地接口原型,不是辅助连接的官方服务。
|
||||
|
||||
运行测试:
|
||||
|
||||
```console
|
||||
python -m unittest discover -s ranch_assistant/tests -v
|
||||
```
|
||||
|
||||
这是本地 Git 仓库。原始 APK、构建包、第三方工具、签名材料、账号会话、
|
||||
密码、数据库、截图和运行日志均由 `.gitignore` 排除;账户数据仍保存在本机。
|
||||
@@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
cd /d "%~dp0"
|
||||
python -m ranch_assistant
|
||||
if errorlevel 1 pause
|
||||
@@ -0,0 +1,124 @@
|
||||
API,用途,路由,请求字段,回调读取字段,调用方法,来源
|
||||
historyService/hisAchiComplete,领取成就奖励,选中游戏服,achiTypeId,reward,finishAchi,analysis/as3/scripts/net/pixvi/myr/net/NetAchi.as:27
|
||||
dailyCheckService/dailyCheck,每日签到,选中游戏服,无显式业务字段,reward,dailyCheckCheck,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:146
|
||||
dailyGiftService/dailyGiftSign,领取每日礼包/签到奖励,选中游戏服,无显式业务字段,"dailyGift, reward",dailyGiftCheck,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:98
|
||||
dailyGiftService/dailyGiftUpdate,更新每日礼包状态,选中游戏服,无显式业务字段,"dailyGift, reward",updateDailyGift,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:114
|
||||
dailyGiftService/dailyLoopReward,领取每日循环奖励,选中游戏服,无显式业务字段,回调透传,LoopCheckReward,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:66
|
||||
vipService/getReward,领取 VIP 奖励,选中游戏服,无显式业务字段,reward,vipDailyGiftCheck,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:130
|
||||
weekActivityService/getWeekActivityReward,领取周活动奖励,选中游戏服,无显式业务字段,回调透传,weekTaskFinish,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:50
|
||||
weekActivityService/queryWeekActivityInfo,查询周活动状态,选中游戏服,无显式业务字段,回调透传,weekTaskInfo,analysis/as3/scripts/net/pixvi/myr/net/NetActi.as:82
|
||||
alchemyStackService/alchemyComplete,领取炼金成品,选中游戏服,alchemyStackId,item,finishAlchemy,analysis/as3/scripts/net/pixvi/myr/net/NetAlchemy.as:67
|
||||
alchemyStackService/alchemyOpen,开启炼金槽,选中游戏服,无显式业务字段,alchemyStack,addAlchemyStack,analysis/as3/scripts/net/pixvi/myr/net/NetAlchemy.as:83
|
||||
alchemyStackService/alchemySpeed,加速炼金,选中游戏服,"stackId, num, itemId",endTime,speedAlchemy,analysis/as3/scripts/net/pixvi/myr/net/NetAlchemy.as:108
|
||||
alchemyStackService/alchemyStart,开始炼金,选中游戏服,"alChemyStackId, materialDic","cost, endTime",startAlchemy,analysis/as3/scripts/net/pixvi/myr/net/NetAlchemy.as:51
|
||||
battleService/battleStart,开始特殊战斗,选中游戏服,"battleType, stageTypeId, stageLevel, taskTypeId",此回调未显式读取字段,startBattle,analysis/as3/scripts/net/pixvi/myr/net/NetBattle.as:54
|
||||
battleService/recordBattleResult,记录特殊战斗结果,选中游戏服,"stageId, cityId, result",此回调未显式读取字段,battleResult,analysis/as3/scripts/net/pixvi/myr/net/NetBattle.as:32
|
||||
worldBossService/finishHuntBoss,结算世界 BOSS 挑战,选中游戏服,"bossId, damage, battleDataReq",回调透传,endBoss,analysis/as3/scripts/net/pixvi/myr/net/NetBoss.as:76
|
||||
worldBossService/getBossRewardByDamage,领取 BOSS 伤害奖励,选中游戏服,bossId,回调透传,getBossReward,analysis/as3/scripts/net/pixvi/myr/net/NetBoss.as:92
|
||||
worldBossService/queryCurrentBoss,查询当前世界 BOSS,选中游戏服,无显式业务字段,回调透传,getBossList,analysis/as3/scripts/net/pixvi/myr/net/NetBoss.as:43
|
||||
worldBossService/queryCurrentBossHp,查询世界 BOSS 剩余生命,选中游戏服,bossId,hp,updateBossHp,analysis/as3/scripts/net/pixvi/myr/net/NetBoss.as:108
|
||||
worldBossService/startHuntBoss,开始世界 BOSS 挑战,选中游戏服,bossId,回调透传,startBoss,analysis/as3/scripts/net/pixvi/myr/net/NetBoss.as:56
|
||||
monsterService/monsterEntangleLevelUp,提升羁绊等级,选中游戏服,monsterId,"entangleLevel, unlockTask",entangleLevelUp,analysis/as3/scripts/net/pixvi/myr/net/NetEntangle.as:54
|
||||
monsterService/monsterMakeEntangle,建立魔物羁绊,选中游戏服,monsterId,unlockTask,makeEntangle,analysis/as3/scripts/net/pixvi/myr/net/NetEntangle.as:38
|
||||
monsterService/monsterResetEntangleSkill,重置羁绊技能,选中游戏服,monsterId,"globalAdd, monAdd",resetEntangleSkill,analysis/as3/scripts/net/pixvi/myr/net/NetEntangle.as:90
|
||||
monsterService/monsterSetEntangleSkill,设置羁绊技能,选中游戏服,"monsterId, entangleSkillLevel, entangleSkillType","globalAdd, monAdd",setEntangleSkill,analysis/as3/scripts/net/pixvi/myr/net/NetEntangle.as:74
|
||||
itemService/itemEquipUnfix,卸下装备,选中游戏服,"monsterId, part",monAdd,equipOff,analysis/as3/scripts/net/pixvi/myr/net/NetEquip.as:52
|
||||
itemService/itemEquipUsed,穿戴装备,选中游戏服,"monsterId, itemId",monAdd,equipOn,analysis/as3/scripts/net/pixvi/myr/net/NetEquip.as:33
|
||||
itemService/itemExchange,兑换物品,选中游戏服,"exchangeId, exchangeNum",reward,exchangeItem,analysis/as3/scripts/net/pixvi/myr/net/NetExchange.as:36
|
||||
exploreService/addTeam,增加探索队伍,选中游戏服,无显式业务字段,exploreTeam,addTeam,analysis/as3/scripts/net/pixvi/myr/net/NetExplore.as:38
|
||||
exploreService/cancelExplore,取消探索,选中游戏服,exploreTeamId,回调透传,cancelExplore,analysis/as3/scripts/net/pixvi/myr/net/NetExplore.as:54
|
||||
exploreService/finish,完成并领取探索奖励,选中游戏服,exploreTeamId,"monExp, rewardResult, unlockStage",finishExplore,analysis/as3/scripts/net/pixvi/myr/net/NetExplore.as:90
|
||||
exploreService/start,派出探索队伍,选中游戏服,"exploreTeamId, monsters, area","exploreTeam, startTime",startExplore,analysis/as3/scripts/net/pixvi/myr/net/NetExplore.as:74
|
||||
gachaService/gachaBuyTimeEgg,购买时段扭蛋,选中游戏服,timeEggId,回调透传,timeEggBuy,analysis/as3/scripts/net/pixvi/myr/net/NetGacha.as:52
|
||||
gachaService/gachaGetEggs,执行扭蛋抽取并返回蛋/附带奖励,选中游戏服,"id, num, voucherNum, traceInfo","eggs, getItem, getMoney",gacha,analysis/as3/scripts/net/pixvi/myr/net/NetGacha.as:83
|
||||
gachaService/gachaTimeEgg,执行时段扭蛋操作,选中游戏服,无显式业务字段,回调透传,timeEggGacha,analysis/as3/scripts/net/pixvi/myr/net/NetGacha.as:36
|
||||
giftService/useGiftCode,兑换礼包码,登录中心,"giftCode, masterId, serverId, isMail","resCode, resMsg, rewardResult",giftCode,analysis/as3/scripts/net/pixvi/myr/net/NetItem.as:91
|
||||
itemService/itemSell,出售物品,选中游戏服,"itemId, num",money,sellItem,analysis/as3/scripts/net/pixvi/myr/net/NetItem.as:46
|
||||
itemService/itemUse,使用物品,选中游戏服,"itemId, num","param, reward",useItem,analysis/as3/scripts/net/pixvi/myr/net/NetItem.as:70
|
||||
mailService/mailBatchDel,批量删除邮件,选中游戏服,mailIds,datas,deleteMail,analysis/as3/scripts/net/pixvi/myr/net/NetMail.as:69
|
||||
mailService/mailGetReward,领取邮件附件,选中游戏服,mailId,回调透传,getReward,analysis/as3/scripts/net/pixvi/myr/net/NetMail.as:86
|
||||
mailService/mailQuery,查询邮件列表,选中游戏服,无显式业务字段,datas,checkNew,analysis/as3/scripts/net/pixvi/myr/net/NetMail.as:53
|
||||
mailService/mailRead,标记邮件已读,选中游戏服,mailIds,此回调未显式读取字段,readMail,analysis/as3/scripts/net/pixvi/myr/net/NetMail.as:38
|
||||
guideService/guideUpdate,更新引导进度,选中游戏服,"{
|
||||
""tag"":guide,
|
||||
""isMain"":isMain
|
||||
}",level,updateGuide,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:235
|
||||
heartBeatService/keepAlive,会话心跳,选中游戏服,无显式业务字段,此回调未显式读取字段,heartBeating,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:113
|
||||
masterService/masterCheckTiAdd,检查体力恢复,选中游戏服,无显式业务字段,"ti, timeTi",checkTi,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:120
|
||||
masterService/masterLevelUpdate,更新角色等级状态,选中游戏服,无显式业务字段,level,checkLevel,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:221
|
||||
masterService/masterNameUpdate,修改角色名字,选中游戏服,newName,回调透传,changeName,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:280
|
||||
masterService/masterQuery,查询角色基础信息,选中游戏服,"{""token"":AccountCenter.getIns().userToken}",masterInfo,loadMasterInfo,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:171
|
||||
masterService/masterQueryDetail,查询角色主快照(牧场、背包、队伍、任务等),选中游戏服,无显式业务字段,此回调未显式读取字段,loadMaster,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:186
|
||||
masterService/queryMasterSecondDetail,查询角色补充信息,选中游戏服,无显式业务字段,"data, resCode",loadMaster2,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:197
|
||||
masterService/queryRoleAvatars,查询可用头像,选中游戏服,无显式业务字段,avatars,getAvatar,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:264
|
||||
masterService/updateMasterAvatar,更换头像,选中游戏服,avatar,此回调未显式读取字段,setAvatar,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:249
|
||||
migrateService/migrateIn,执行角色迁入,登录中心,"migrateCode, sdkUid, channel, platform",回调透传,startZhuanyi,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:99
|
||||
migrateService/migrateOut,执行角色迁出,登录中心,masterId,回调透传,openZhuanyi,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:78
|
||||
userServerService/createMaster,创建区服角色,登录中心,"roleName, serverId, avatar, tjChannel, random","masterInfo, resCode",createMaster,analysis/as3/scripts/net/pixvi/myr/net/NetMaster.as:142
|
||||
archiveInfoService/getArchiveInfo,读取小游戏存档,选中游戏服,typeId,archiveInfo,loadData,analysis/as3/scripts/net/pixvi/myr/net/NetMiniGame.as:67
|
||||
archiveInfoService/saveInfo,保存小游戏存档,选中游戏服,"typeId, data, keyValue1, keyValue2, dataTime",回调透传,saveData,analysis/as3/scripts/net/pixvi/myr/net/NetMiniGame.as:51
|
||||
miniGameService/gameOver,结算小游戏,选中游戏服,score,回调透传,miniGameOver,analysis/as3/scripts/net/pixvi/myr/net/NetMiniGame.as:97
|
||||
miniGameService/gameStart,开始小游戏,选中游戏服,type,此回调未显式读取字段,miniGameStart,analysis/as3/scripts/net/pixvi/myr/net/NetMiniGame.as:81
|
||||
miniGameService/getRecord,查询小游戏记录,选中游戏服,无显式业务字段,回调透传,getRecord,analysis/as3/scripts/net/pixvi/myr/net/NetMiniGame.as:113
|
||||
monsterService/monsterExchange,交换魔物成长属性,选中游戏服,"monsterIdA, monsterIdB",此回调未显式读取字段,switchGrowth,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:232
|
||||
monsterService/monsterIntensify,消耗素材魔物强化目标魔物,选中游戏服,"targetId, foods","exp, level, tpExp, tpLevel",feedMonster,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:159
|
||||
monsterService/monsterLock,锁定/解锁魔物,选中游戏服,"monsterId, lock",此回调未显式读取字段,setLock,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:251
|
||||
monsterService/monsterNameUpdate,修改魔物名字,选中游戏服,"monsterId, name",此回调未显式读取字段,changeName,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:178
|
||||
monsterService/monsterPotential,处理魔物潜能(仅常量,未找到 send 调用),未确认,未确认,未确认,ADD_POTENTIAL,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:20
|
||||
monsterService/monsterQualification,重设/提升魔物资质,选中游戏服,monId,回调透传,addCz,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:82
|
||||
monsterService/monsterSell,派遣/出售魔物,选中游戏服,monsterIds,money,sellMonsters,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:194
|
||||
monsterService/monsterSendGift,给魔物赠礼,选中游戏服,"monsterId, itemId","addFeel, feel, giftDate",gift,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:140
|
||||
monsterService/monsterTranster2Room,转移魔物到牧场(保留原拼写),选中游戏服,"monsterId, itemId, addType",此回调未显式读取字段,addPotential,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:102
|
||||
monsterService/monsterTranster2Room,转移魔物到牧场(保留原拼写),选中游戏服,"monsterId, roomId",此回调未显式读取字段,moveMonFromRoom,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:121
|
||||
monsterService/monsterTranster2Room,转移魔物到牧场(保留原拼写),选中游戏服,"monsterId, roomId",此回调未显式读取字段,changeRoom,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:213
|
||||
monsterService/monsterUpStar,提升魔物星级,选中游戏服,monId,回调透传,upStar,analysis/as3/scripts/net/pixvi/myr/net/NetMonster.as:66
|
||||
pay-server/pay/getPayReward,查询/领取已支付订单奖励,区服支付服,"tradeId, uid, outOrderNo, phoneModel, deviceId, osType, imei, tjChannel","payRwardResult, resCode, resMsg",sendGetTradeReward,analysis/as3/scripts/net/pixvi/myr/net/NetPay.as:138
|
||||
pay-server/pay/payApply,申请支付交易号,区服支付服,"rewardTypeId, masterId, serverId, money, payAccountName, channel, tjChannel, imei","extResponse, resCode, resMsg, tradeId",getTradeId,analysis/as3/scripts/net/pixvi/myr/net/NetPay.as:63
|
||||
pay-server/pay/queryNoGetRewardPay,查询未领取的支付订单,区服支付服,masterId,notGetRewardOrderList,getPayRewardList,analysis/as3/scripts/net/pixvi/myr/net/NetPay.as:167
|
||||
pay-server/timeRecharge/getChargeReward,领取时段充值奖励,区服支付服,"masterId, chargeRewardId",reward,timeChargeReward,analysis/as3/scripts/net/pixvi/myr/net/NetPayPoint.as:75
|
||||
pay-server/timeRecharge/getChargeRewardList,查询时段充值奖励列表,区服支付服,"masterId, startTime, endTime",回调透传,timeChargeInfo,analysis/as3/scripts/net/pixvi/myr/net/NetPayPoint.as:56
|
||||
rechargeService/getPayGift,领取充值积分礼包,选中游戏服,giftTypeId,reward,payPointReward,analysis/as3/scripts/net/pixvi/myr/net/NetPayPoint.as:36
|
||||
monsterService/monsterPotentialLevelUpgrade,提升魔物潜能等级,选中游戏服,"monId, itemIds",potentailLevel,potentialLevelUp,analysis/as3/scripts/net/pixvi/myr/net/NetPotential.as:54
|
||||
monsterService/monsterPotentialUpgrade,提升魔物潜能阶段,选中游戏服,"traceInfo, monId, itemId, monsterAttr","pAtk, pDef, pDex, pHp",addPotential,analysis/as3/scripts/net/pixvi/myr/net/NetPotential.as:35
|
||||
pveService/finishPVE,结算 PVE 活动挑战,选中游戏服,"battleDataReq, pveAreaName",回调透传,finishPve,analysis/as3/scripts/net/pixvi/myr/net/NetPve.as:58
|
||||
pveService/getPVEWeekReward,领取 PVE 周奖励,选中游戏服,pveAreaName,回调透传,weekReward,analysis/as3/scripts/net/pixvi/myr/net/NetPve.as:74
|
||||
pveService/queryPVEInfo,查询 PVE 活动信息,选中游戏服,无显式业务字段,pveInfo,getPveInfo,analysis/as3/scripts/net/pixvi/myr/net/NetPve.as:90
|
||||
pveService/startPVE,开始 PVE 活动挑战,选中游戏服,pveAreaName,回调透传,startPve,analysis/as3/scripts/net/pixvi/myr/net/NetPve.as:39
|
||||
gameEventService/finishFarmEvent,完成牧场随机事件,选中游戏服,无显式业务字段,"getTasks, result, unlockTasks",finishFarmEvent,analysis/as3/scripts/net/pixvi/myr/net/NetRandomEvent.as:46
|
||||
gameEventService/getFarmEvent,查询牧场随机事件,选中游戏服,无显式业务字段,"currentTime, masterEventTimer, triggerEvent, typeId",getFarmEvent,analysis/as3/scripts/net/pixvi/myr/net/NetRandomEvent.as:30
|
||||
rankService/queryRank,查询排行榜,选中游戏服,rankName,回调透传,getRank,analysis/as3/scripts/net/pixvi/myr/net/NetRank.as:26
|
||||
roomService/roomCreateByKe,用氪金建造牧场,选中游戏服,无显式业务字段,room,createRoom,analysis/as3/scripts/net/pixvi/myr/net/NetRoom.as:60
|
||||
roomService/roomCreateByMoney,用金币建造牧场,选中游戏服,无显式业务字段,room,createRoom,analysis/as3/scripts/net/pixvi/myr/net/NetRoom.as:56
|
||||
roomService/roomUpgrade,升级牧场,选中游戏服,"roomId, targetTypeId, useVoucher",room,editRoom,analysis/as3/scripts/net/pixvi/myr/net/NetRoom.as:38
|
||||
shopService/shopItemBuy,购买商店物品,选中游戏服,"shopId, shopType, num","costKe, costMoney, items",buyShopItem,analysis/as3/scripts/net/pixvi/myr/net/NetShop.as:41
|
||||
shopService/shopQuery,查询商店商品,选中游戏服,无显式业务字段,"keShopList, moneyShopList, shopBuyNum",getShopInfo,analysis/as3/scripts/net/pixvi/myr/net/NetShop.as:57
|
||||
monsterService/monsterSetSkin,设置魔物皮肤,选中游戏服,"monsterId, skinType",回调透传,setSkin,analysis/as3/scripts/net/pixvi/myr/net/NetSkin.as:29
|
||||
monsterService/monsterSell,派遣/出售魔物,选中游戏服,monsterId,money,sellMonsters,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:137
|
||||
stackService/stackAddMonster,向培育槽放入魔物蛋,选中游戏服,eggs,monsters,pushEgg,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:90
|
||||
stackService/stackCheckProcess,推进/检查培育成长阶段,选中游戏服,无显式业务字段,"allExp, datas, stackMonsterInfos",checkGrowth,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:121
|
||||
stackService/stackGrowthNumber,增加培育槽属性加成次数,选中游戏服,"stackId, name",回调透传,addQuality,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:55
|
||||
stackService/stackOpen,开启培育槽,选中游戏服,"openType, position",stack,addStack,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:74
|
||||
stackService/stackSpeedUp,加速培育,选中游戏服,"monsterId, num",startTime,speedMonsters,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:162
|
||||
stackService/stackTransferMonster,从培育槽收取魔物到牧场,选中游戏服,datas,此回调未显式读取字段,moveMonster,analysis/as3/scripts/net/pixvi/myr/net/NetStack.as:106
|
||||
battleService/battleEnd,提交普通关卡战斗数据并结算,选中游戏服,battleData,"costTi, lockStage, monsterExpInfos, reward, unlockStage",finishStageBattle,analysis/as3/scripts/net/pixvi/myr/net/NetStage.as:89
|
||||
loopStageService/checkNextWeek,检查循环关卡跨周更新,选中游戏服,无显式业务字段,回调透传,checkLoopStage,analysis/as3/scripts/net/pixvi/myr/net/NetStage.as:54
|
||||
loopStageService/getStageReward,领取循环关卡阶段奖励,选中游戏服,rewardId,回调透传,getStageReward,analysis/as3/scripts/net/pixvi/myr/net/NetStage.as:38
|
||||
stageService/stageStart,进入指定关卡和难度,选中游戏服,"stageTypeId, stageLevel","stageEvent, triggerEvent",startStage,analysis/as3/scripts/net/pixvi/myr/net/NetStage.as:73
|
||||
gameService/queryGameConfig,查询游戏配置,选中游戏服,无显式业务字段,config,getConfig,analysis/as3/scripts/net/pixvi/myr/net/NetSystem.as:115
|
||||
gameService/queryGameNotice,查询公告,选中游戏服,无显式业务字段,gameNotice,getNotice,analysis/as3/scripts/net/pixvi/myr/net/NetSystem.as:91
|
||||
getSysCurTime/execute,查询系统时间,选中游戏服,无显式业务字段,time,synchroTime,analysis/as3/scripts/net/pixvi/myr/net/NetSystem.as:44
|
||||
userServerService/firstOpenGame,上报首次启动,登录中心,"os, osType, phoneScreen, phoneFactory, phoneModel, channel, isp, network, deviceId, imei, tjChannel",此回调未显式读取字段,firstOpen,analysis/as3/scripts/net/pixvi/myr/net/NetSystem.as:76
|
||||
taskService/taskComplete,完成任务并领取奖励,选中游戏服,"taskId, taskTypeId","nextTasks, reward, unlockStages, unlockTasks",finishTask,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:94
|
||||
taskService/taskCompleteStep,推进任务当前步骤,选中游戏服,"taskId, removeIds, taskTypeId, battleData","reward, stageReward",finishStep,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:70
|
||||
taskService/taskLoopFlush,刷新每日循环委托,选中游戏服,无显式业务字段,loopTask,resetLoopTask,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:110
|
||||
taskService/taskLoopReceive,接取指定城市的循环委托,选中游戏服,"taskTypeId, city",task,getLoopTask,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:129
|
||||
taskService/taskReceive,接取普通任务,选中游戏服,taskTypeId,task,getTask,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:46
|
||||
taskService/taskUpdate,更新任务状态/解锁,选中游戏服,"unlockTasks, receiveTasks, removeTasks","receiveTasks, unlockTasks",updateTask,analysis/as3/scripts/net/pixvi/myr/net/NetTask.as:149
|
||||
monsterService/monsterPlaceBattleTeam,将魔物加入战斗队伍,选中游戏服,"monsterId, battleTeamName, position",此回调未显式读取字段,monOn,analysis/as3/scripts/net/pixvi/myr/net/NetTeam.as:34
|
||||
monsterService/monsterWithdrawBattleTeam,从战斗队伍移除魔物,选中游戏服,"battleTeamName, position",此回调未显式读取字段,monOff,analysis/as3/scripts/net/pixvi/myr/net/NetTeam.as:53
|
||||
userInfoService/userActive,提交激活码,选中游戏服,activeCode,回调透传,activity,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:205
|
||||
userInfoService/userRegister,客户端保留的游戏用户注册路径,登录中心,"userName, passWord",回调透传,register,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:104
|
||||
userServerService/enterGame,选择区服并进入游戏,登录中心,"serverId, deviceId, network, isp, imei, tjChannel, random, osType",回调透传,selectServer,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:140
|
||||
userServerService/loginUser,用渠道会话登录中心并取得区服/角色列表;另有开发模式调用,登录中心,"sdkUid, sdkToken, deviceId, channel, platform, loginType, imei, osType, tjChannel, network, isp",回调透传,sdkLogin,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:86
|
||||
userServerService/loginUser,客户端保留的开发模式登录(loginType=dev);辅助不使用此模式,登录中心,"channel, platform, loginType, password, sdkUid, network, isp, tjChannel",回调透传,login,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:188
|
||||
userServerService/userCertification,提交游戏侧实名信息,登录中心,"userName, idCard",回调透传,setRealName,analysis/as3/scripts/net/pixvi/myr/net/NetUser.as:56
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,349 @@
|
||||
# 牧羊人之心客户端接口清单
|
||||
|
||||
生成日期:2026-11-07。来源:用户提供的 1.9.68 APK 留存反编译代码。
|
||||
|
||||
发现 **116 个游戏侧路径**,其中 **115 个找到实际 send 调用**;另列 **13 种渠道 SDK 调用方式**。
|
||||
主体依据客户端静态证据,用途根据调用方法、参数和回调推定。账号验证、中心登录、进入区服和角色读取已由用户实测成功;其他接口未做官方实服验证。
|
||||
|
||||
## 阅读方式
|
||||
|
||||
- 表内请求字段不含统一注入的 `token`、`reqid`、`reqsid`;空字段表示包装方法没有显式业务字段。
|
||||
- 返回字段是该方法回调直接读取的字段,不是完整响应 Schema。`回调透传` 表示把整个响应交给上层。
|
||||
- `JSON` 文件保留每个调用位置、方法签名、参数表达式、回调字段与路由;CSV 可直接用 Excel 打开。
|
||||
- 普通游戏接口是 POST,JSON 经 AES-ECB + PKCS7 + Base64 后作为请求体;支付调用有单独的路由/编码开关。
|
||||
- 登录中心来自 APK 配置;进入区服后的地址来自官方返回的 `gameServerAddress`;支付地址来自 `payServerAddress`。
|
||||
|
||||
## 登录顺序与当前排查
|
||||
|
||||
1. `POST https://gameapi.diyidan.net/g0.3/users/reallogin`:发送渠道账号密码,取 SDK 用户会话。
|
||||
2. `userServerService/loginUser`:发送 SDK 用户 ID/Token、渠道和平台,客户端读取 `playerInfo`、`servers`、`masterInfos`。
|
||||
3. 用户选择返回的区服后,`userServerService/enterGame`:发送 `serverId`、设备信息和客户端计算的 `random`。
|
||||
4. 对选中区服调用 `masterService/masterQueryDetail`,读取角色与牧场/背包/任务等状态。
|
||||
|
||||
签名日期必须跟随 `Paster.timestampFormat` 的实际实现:格式串 `yyMMdd` 中的 `yy` 被替换为四位 `Date.fullYear`,因此日期是八位 `yyyyMMdd`。
|
||||
`channel` 与 `tjChannel` 不同:这份 APK 的渠道为 `DYD`,而 `assets/tjchannel.json` 中的追踪渠道为 `taptap`。
|
||||
辅助已修正这两处进入参数,并在调试日志的“进入参数检查”中记录日期、规则和渠道,不记录签名原文或 Token。
|
||||
|
||||
旧版 `AccountCenter.as` 使用 `servers[].id`;内部 `ServerVo` 保存为 `serverId`;`masterInfos[].id` 是角色编号。
|
||||
实际登录日志返回前两条完整区服(含 `id`),后两条是 `$.servers[0]` / `$.servers[1]` 的 `$ref` 引用。
|
||||
辅助现已还原数组引用、按区服编号去重,并按 `masterInfos[].serverId` 关联角色名;本地整理不会再发请求。
|
||||
调试窗口已记录进入解析器之前的解密响应,文件为 `local_state/ranch_helper/network_debug.jsonl`。
|
||||
|
||||
## 培育室和冒险的关键组合
|
||||
|
||||
- 看培育槽/背包:`masterQueryDetail`;刷新成长:`stackCheckProcess`;放蛋:`stackAddMonster`。
|
||||
- 收取到牧场:`stackTransferMonster`,`datas` 内具体结构需结合调用者;派遣:`monsterSell`。
|
||||
- 注意 `NetStack.sellMonsters` 发送 `monsterId` 数组,`NetMonster.sellMonsters` 发送 `monsterIds` 数组,不能混用包装层。
|
||||
- 喂养升级:`monsterIntensify`,目标 `targetId`,素材数组 `foods`。
|
||||
- 委托:`taskLoopFlush` → `taskLoopReceive` → `taskCompleteStep` → `taskComplete`。
|
||||
- 普通冒险:`stageStart` → 客户端实际战斗 → `battleEnd`。后者提交 `battleData`,包含伤害、击杀、时间、阵容等。
|
||||
- 本次范围未发现独立扫荡路径;战斗结算不是只发成功标志。服务端如何验证仍未知。
|
||||
|
||||
## 游戏接口(按功能)
|
||||
|
||||
### 成就(NetAchi)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `historyService/hisAchiComplete` | 领取成就奖励 | `achiTypeId` | `reward` | [NetAchi.as:27](as3/scripts/net/pixvi/myr/net/NetAchi.as#L27) |
|
||||
|
||||
### 签到与活动(NetActi)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `dailyCheckService/dailyCheck` | 每日签到 | `无显式业务字段` | `reward` | [NetActi.as:146](as3/scripts/net/pixvi/myr/net/NetActi.as#L146) |
|
||||
| `dailyGiftService/dailyGiftSign` | 领取每日礼包/签到奖励 | `无显式业务字段` | `dailyGift, reward` | [NetActi.as:98](as3/scripts/net/pixvi/myr/net/NetActi.as#L98) |
|
||||
| `dailyGiftService/dailyGiftUpdate` | 更新每日礼包状态 | `无显式业务字段` | `dailyGift, reward` | [NetActi.as:114](as3/scripts/net/pixvi/myr/net/NetActi.as#L114) |
|
||||
| `dailyGiftService/dailyLoopReward` | 领取每日循环奖励 | `无显式业务字段` | `回调透传` | [NetActi.as:66](as3/scripts/net/pixvi/myr/net/NetActi.as#L66) |
|
||||
| `vipService/getReward` | 领取 VIP 奖励 | `无显式业务字段` | `reward` | [NetActi.as:130](as3/scripts/net/pixvi/myr/net/NetActi.as#L130) |
|
||||
| `weekActivityService/getWeekActivityReward` | 领取周活动奖励 | `无显式业务字段` | `回调透传` | [NetActi.as:50](as3/scripts/net/pixvi/myr/net/NetActi.as#L50) |
|
||||
| `weekActivityService/queryWeekActivityInfo` | 查询周活动状态 | `无显式业务字段` | `回调透传` | [NetActi.as:82](as3/scripts/net/pixvi/myr/net/NetActi.as#L82) |
|
||||
|
||||
### 炼金(NetAlchemy)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `alchemyStackService/alchemyComplete` | 领取炼金成品 | `alchemyStackId` | `item` | [NetAlchemy.as:67](as3/scripts/net/pixvi/myr/net/NetAlchemy.as#L67) |
|
||||
| `alchemyStackService/alchemyOpen` | 开启炼金槽 | `无显式业务字段` | `alchemyStack` | [NetAlchemy.as:83](as3/scripts/net/pixvi/myr/net/NetAlchemy.as#L83) |
|
||||
| `alchemyStackService/alchemySpeed` | 加速炼金 | `stackId, num, itemId` | `endTime` | [NetAlchemy.as:108](as3/scripts/net/pixvi/myr/net/NetAlchemy.as#L108) |
|
||||
| `alchemyStackService/alchemyStart` | 开始炼金 | `alChemyStackId, materialDic` | `cost, endTime` | [NetAlchemy.as:51](as3/scripts/net/pixvi/myr/net/NetAlchemy.as#L51) |
|
||||
|
||||
### 特殊战斗(NetBattle)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `battleService/battleStart` | 开始特殊战斗 | `battleType, stageTypeId, stageLevel, taskTypeId` | `此回调未显式读取字段` | [NetBattle.as:54](as3/scripts/net/pixvi/myr/net/NetBattle.as#L54) |
|
||||
| `battleService/recordBattleResult` | 记录特殊战斗结果 | `stageId, cityId, result` | `此回调未显式读取字段` | [NetBattle.as:32](as3/scripts/net/pixvi/myr/net/NetBattle.as#L32) |
|
||||
|
||||
### 世界 BOSS(NetBoss)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `worldBossService/finishHuntBoss` | 结算世界 BOSS 挑战 | `bossId, damage, battleDataReq` | `回调透传` | [NetBoss.as:76](as3/scripts/net/pixvi/myr/net/NetBoss.as#L76) |
|
||||
| `worldBossService/getBossRewardByDamage` | 领取 BOSS 伤害奖励 | `bossId` | `回调透传` | [NetBoss.as:92](as3/scripts/net/pixvi/myr/net/NetBoss.as#L92) |
|
||||
| `worldBossService/queryCurrentBoss` | 查询当前世界 BOSS | `无显式业务字段` | `回调透传` | [NetBoss.as:43](as3/scripts/net/pixvi/myr/net/NetBoss.as#L43) |
|
||||
| `worldBossService/queryCurrentBossHp` | 查询世界 BOSS 剩余生命 | `bossId` | `hp` | [NetBoss.as:108](as3/scripts/net/pixvi/myr/net/NetBoss.as#L108) |
|
||||
| `worldBossService/startHuntBoss` | 开始世界 BOSS 挑战 | `bossId` | `回调透传` | [NetBoss.as:56](as3/scripts/net/pixvi/myr/net/NetBoss.as#L56) |
|
||||
|
||||
### 羁绊(NetEntangle)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterEntangleLevelUp` | 提升羁绊等级 | `monsterId` | `entangleLevel, unlockTask` | [NetEntangle.as:54](as3/scripts/net/pixvi/myr/net/NetEntangle.as#L54) |
|
||||
| `monsterService/monsterMakeEntangle` | 建立魔物羁绊 | `monsterId` | `unlockTask` | [NetEntangle.as:38](as3/scripts/net/pixvi/myr/net/NetEntangle.as#L38) |
|
||||
| `monsterService/monsterResetEntangleSkill` | 重置羁绊技能 | `monsterId` | `globalAdd, monAdd` | [NetEntangle.as:90](as3/scripts/net/pixvi/myr/net/NetEntangle.as#L90) |
|
||||
| `monsterService/monsterSetEntangleSkill` | 设置羁绊技能 | `monsterId, entangleSkillLevel, entangleSkillType` | `globalAdd, monAdd` | [NetEntangle.as:74](as3/scripts/net/pixvi/myr/net/NetEntangle.as#L74) |
|
||||
|
||||
### 装备(NetEquip)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `itemService/itemEquipUnfix` | 卸下装备 | `monsterId, part` | `monAdd` | [NetEquip.as:52](as3/scripts/net/pixvi/myr/net/NetEquip.as#L52) |
|
||||
| `itemService/itemEquipUsed` | 穿戴装备 | `monsterId, itemId` | `monAdd` | [NetEquip.as:33](as3/scripts/net/pixvi/myr/net/NetEquip.as#L33) |
|
||||
|
||||
### 物品兑换(NetExchange)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `itemService/itemExchange` | 兑换物品 | `exchangeId, exchangeNum` | `reward` | [NetExchange.as:36](as3/scripts/net/pixvi/myr/net/NetExchange.as#L36) |
|
||||
|
||||
### 探索派遣(NetExplore)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `exploreService/addTeam` | 增加探索队伍 | `无显式业务字段` | `exploreTeam` | [NetExplore.as:38](as3/scripts/net/pixvi/myr/net/NetExplore.as#L38) |
|
||||
| `exploreService/cancelExplore` | 取消探索 | `exploreTeamId` | `回调透传` | [NetExplore.as:54](as3/scripts/net/pixvi/myr/net/NetExplore.as#L54) |
|
||||
| `exploreService/finish` | 完成并领取探索奖励 | `exploreTeamId` | `monExp, rewardResult, unlockStage` | [NetExplore.as:90](as3/scripts/net/pixvi/myr/net/NetExplore.as#L90) |
|
||||
| `exploreService/start` | 派出探索队伍 | `exploreTeamId, monsters, area` | `exploreTeam, startTime` | [NetExplore.as:74](as3/scripts/net/pixvi/myr/net/NetExplore.as#L74) |
|
||||
|
||||
### 扭蛋(NetGacha)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `gachaService/gachaBuyTimeEgg` | 购买时段扭蛋 | `timeEggId` | `回调透传` | [NetGacha.as:52](as3/scripts/net/pixvi/myr/net/NetGacha.as#L52) |
|
||||
| `gachaService/gachaGetEggs` | 执行扭蛋抽取并返回蛋/附带奖励 | `id, num, voucherNum, traceInfo` | `eggs, getItem, getMoney` | [NetGacha.as:83](as3/scripts/net/pixvi/myr/net/NetGacha.as#L83) |
|
||||
| `gachaService/gachaTimeEgg` | 执行时段扭蛋操作 | `无显式业务字段` | `回调透传` | [NetGacha.as:36](as3/scripts/net/pixvi/myr/net/NetGacha.as#L36) |
|
||||
|
||||
### 物品与礼包码(NetItem)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `giftService/useGiftCode` | 兑换礼包码 | `giftCode, masterId, serverId, isMail` | `resCode, resMsg, rewardResult` | [NetItem.as:91](as3/scripts/net/pixvi/myr/net/NetItem.as#L91) |
|
||||
| `itemService/itemSell` | 出售物品 | `itemId, num` | `money` | [NetItem.as:46](as3/scripts/net/pixvi/myr/net/NetItem.as#L46) |
|
||||
| `itemService/itemUse` | 使用物品 | `itemId, num` | `param, reward` | [NetItem.as:70](as3/scripts/net/pixvi/myr/net/NetItem.as#L70) |
|
||||
|
||||
### 邮件(NetMail)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `mailService/mailBatchDel` | 批量删除邮件 | `mailIds` | `datas` | [NetMail.as:69](as3/scripts/net/pixvi/myr/net/NetMail.as#L69) |
|
||||
| `mailService/mailGetReward` | 领取邮件附件 | `mailId` | `回调透传` | [NetMail.as:86](as3/scripts/net/pixvi/myr/net/NetMail.as#L86) |
|
||||
| `mailService/mailQuery` | 查询邮件列表 | `无显式业务字段` | `datas` | [NetMail.as:53](as3/scripts/net/pixvi/myr/net/NetMail.as#L53) |
|
||||
| `mailService/mailRead` | 标记邮件已读 | `mailIds` | `此回调未显式读取字段` | [NetMail.as:38](as3/scripts/net/pixvi/myr/net/NetMail.as#L38) |
|
||||
|
||||
### 角色、体力与迁移(NetMaster)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `guideService/guideUpdate` | 更新引导进度 | `{
|
||||
"tag":guide,
|
||||
"isMain":isMain
|
||||
}` | `level` | [NetMaster.as:235](as3/scripts/net/pixvi/myr/net/NetMaster.as#L235) |
|
||||
| `heartBeatService/keepAlive` | 会话心跳 | `无显式业务字段` | `此回调未显式读取字段` | [NetMaster.as:113](as3/scripts/net/pixvi/myr/net/NetMaster.as#L113) |
|
||||
| `masterService/masterCheckTiAdd` | 检查体力恢复 | `无显式业务字段` | `ti, timeTi` | [NetMaster.as:120](as3/scripts/net/pixvi/myr/net/NetMaster.as#L120) |
|
||||
| `masterService/masterLevelUpdate` | 更新角色等级状态 | `无显式业务字段` | `level` | [NetMaster.as:221](as3/scripts/net/pixvi/myr/net/NetMaster.as#L221) |
|
||||
| `masterService/masterNameUpdate` | 修改角色名字 | `newName` | `回调透传` | [NetMaster.as:280](as3/scripts/net/pixvi/myr/net/NetMaster.as#L280) |
|
||||
| `masterService/masterQuery` | 查询角色基础信息 | `{"token":AccountCenter.getIns().userToken}` | `masterInfo` | [NetMaster.as:171](as3/scripts/net/pixvi/myr/net/NetMaster.as#L171) |
|
||||
| `masterService/masterQueryDetail` | 查询角色主快照(牧场、背包、队伍、任务等) | `无显式业务字段` | `此回调未显式读取字段` | [NetMaster.as:186](as3/scripts/net/pixvi/myr/net/NetMaster.as#L186) |
|
||||
| `masterService/queryMasterSecondDetail` | 查询角色补充信息 | `无显式业务字段` | `data, resCode` | [NetMaster.as:197](as3/scripts/net/pixvi/myr/net/NetMaster.as#L197) |
|
||||
| `masterService/queryRoleAvatars` | 查询可用头像 | `无显式业务字段` | `avatars` | [NetMaster.as:264](as3/scripts/net/pixvi/myr/net/NetMaster.as#L264) |
|
||||
| `masterService/updateMasterAvatar` | 更换头像 | `avatar` | `此回调未显式读取字段` | [NetMaster.as:249](as3/scripts/net/pixvi/myr/net/NetMaster.as#L249) |
|
||||
| `migrateService/migrateIn` | 执行角色迁入 | `migrateCode, sdkUid, channel, platform` | `回调透传` | [NetMaster.as:99](as3/scripts/net/pixvi/myr/net/NetMaster.as#L99) |
|
||||
| `migrateService/migrateOut` | 执行角色迁出 | `masterId` | `回调透传` | [NetMaster.as:78](as3/scripts/net/pixvi/myr/net/NetMaster.as#L78) |
|
||||
| `userServerService/createMaster` | 创建区服角色 | `roleName, serverId, avatar, tjChannel, random` | `masterInfo, resCode` | [NetMaster.as:142](as3/scripts/net/pixvi/myr/net/NetMaster.as#L142) |
|
||||
|
||||
### 小游戏与存档(NetMiniGame)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `archiveInfoService/getArchiveInfo` | 读取小游戏存档 | `typeId` | `archiveInfo` | [NetMiniGame.as:67](as3/scripts/net/pixvi/myr/net/NetMiniGame.as#L67) |
|
||||
| `archiveInfoService/saveInfo` | 保存小游戏存档 | `typeId, data, keyValue1, keyValue2, dataTime` | `回调透传` | [NetMiniGame.as:51](as3/scripts/net/pixvi/myr/net/NetMiniGame.as#L51) |
|
||||
| `miniGameService/gameOver` | 结算小游戏 | `score` | `回调透传` | [NetMiniGame.as:97](as3/scripts/net/pixvi/myr/net/NetMiniGame.as#L97) |
|
||||
| `miniGameService/gameStart` | 开始小游戏 | `type` | `此回调未显式读取字段` | [NetMiniGame.as:81](as3/scripts/net/pixvi/myr/net/NetMiniGame.as#L81) |
|
||||
| `miniGameService/getRecord` | 查询小游戏记录 | `无显式业务字段` | `回调透传` | [NetMiniGame.as:113](as3/scripts/net/pixvi/myr/net/NetMiniGame.as#L113) |
|
||||
|
||||
### 魔物管理(NetMonster)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterExchange` | 交换魔物成长属性 | `monsterIdA, monsterIdB` | `此回调未显式读取字段` | [NetMonster.as:232](as3/scripts/net/pixvi/myr/net/NetMonster.as#L232) |
|
||||
| `monsterService/monsterIntensify` | 消耗素材魔物强化目标魔物 | `targetId, foods` | `exp, level, tpExp, tpLevel` | [NetMonster.as:159](as3/scripts/net/pixvi/myr/net/NetMonster.as#L159) |
|
||||
| `monsterService/monsterLock` | 锁定/解锁魔物 | `monsterId, lock` | `此回调未显式读取字段` | [NetMonster.as:251](as3/scripts/net/pixvi/myr/net/NetMonster.as#L251) |
|
||||
| `monsterService/monsterNameUpdate` | 修改魔物名字 | `monsterId, name` | `此回调未显式读取字段` | [NetMonster.as:178](as3/scripts/net/pixvi/myr/net/NetMonster.as#L178) |
|
||||
| `monsterService/monsterPotential` | 处理魔物潜能(仅常量,未找到 send 调用) | 未确认 | 未确认 | [NetMonster.as:20](as3/scripts/net/pixvi/myr/net/NetMonster.as#L20) |
|
||||
| `monsterService/monsterQualification` | 重设/提升魔物资质 | `monId` | `回调透传` | [NetMonster.as:82](as3/scripts/net/pixvi/myr/net/NetMonster.as#L82) |
|
||||
| `monsterService/monsterSell` | 派遣/出售魔物 | `monsterIds` | `money` | [NetMonster.as:194](as3/scripts/net/pixvi/myr/net/NetMonster.as#L194) |
|
||||
| `monsterService/monsterSendGift` | 给魔物赠礼 | `monsterId, itemId` | `addFeel, feel, giftDate` | [NetMonster.as:140](as3/scripts/net/pixvi/myr/net/NetMonster.as#L140) |
|
||||
| `monsterService/monsterTranster2Room` | 转移魔物到牧场(保留原拼写) | `monsterId, itemId, addType` | `此回调未显式读取字段` | [NetMonster.as:102](as3/scripts/net/pixvi/myr/net/NetMonster.as#L102) |
|
||||
| `monsterService/monsterTranster2Room` | 转移魔物到牧场(保留原拼写) | `monsterId, roomId` | `此回调未显式读取字段` | [NetMonster.as:121](as3/scripts/net/pixvi/myr/net/NetMonster.as#L121) |
|
||||
| `monsterService/monsterTranster2Room` | 转移魔物到牧场(保留原拼写) | `monsterId, roomId` | `此回调未显式读取字段` | [NetMonster.as:213](as3/scripts/net/pixvi/myr/net/NetMonster.as#L213) |
|
||||
| `monsterService/monsterUpStar` | 提升魔物星级 | `monId` | `回调透传` | [NetMonster.as:66](as3/scripts/net/pixvi/myr/net/NetMonster.as#L66) |
|
||||
|
||||
### 支付订单(NetPay)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `pay-server/pay/getPayReward` | 查询/领取已支付订单奖励 | `tradeId, uid, outOrderNo, phoneModel, deviceId, osType, imei, tjChannel` | `payRwardResult, resCode, resMsg` | [NetPay.as:138](as3/scripts/net/pixvi/myr/net/NetPay.as#L138) |
|
||||
| `pay-server/pay/payApply` | 申请支付交易号 | `rewardTypeId, masterId, serverId, money, payAccountName, channel, tjChannel, imei` | `extResponse, resCode, resMsg, tradeId` | [NetPay.as:63](as3/scripts/net/pixvi/myr/net/NetPay.as#L63) |
|
||||
| `pay-server/pay/queryNoGetRewardPay` | 查询未领取的支付订单 | `masterId` | `notGetRewardOrderList` | [NetPay.as:167](as3/scripts/net/pixvi/myr/net/NetPay.as#L167) |
|
||||
|
||||
### 充值奖励(NetPayPoint)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `pay-server/timeRecharge/getChargeReward` | 领取时段充值奖励 | `masterId, chargeRewardId` | `reward` | [NetPayPoint.as:75](as3/scripts/net/pixvi/myr/net/NetPayPoint.as#L75) |
|
||||
| `pay-server/timeRecharge/getChargeRewardList` | 查询时段充值奖励列表 | `masterId, startTime, endTime` | `回调透传` | [NetPayPoint.as:56](as3/scripts/net/pixvi/myr/net/NetPayPoint.as#L56) |
|
||||
| `rechargeService/getPayGift` | 领取充值积分礼包 | `giftTypeId` | `reward` | [NetPayPoint.as:36](as3/scripts/net/pixvi/myr/net/NetPayPoint.as#L36) |
|
||||
|
||||
### 潜能(NetPotential)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterPotentialLevelUpgrade` | 提升魔物潜能等级 | `monId, itemIds` | `potentailLevel` | [NetPotential.as:54](as3/scripts/net/pixvi/myr/net/NetPotential.as#L54) |
|
||||
| `monsterService/monsterPotentialUpgrade` | 提升魔物潜能阶段 | `traceInfo, monId, itemId, monsterAttr` | `pAtk, pDef, pDex, pHp` | [NetPotential.as:35](as3/scripts/net/pixvi/myr/net/NetPotential.as#L35) |
|
||||
|
||||
### PVE 活动(NetPve)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `pveService/finishPVE` | 结算 PVE 活动挑战 | `battleDataReq, pveAreaName` | `回调透传` | [NetPve.as:58](as3/scripts/net/pixvi/myr/net/NetPve.as#L58) |
|
||||
| `pveService/getPVEWeekReward` | 领取 PVE 周奖励 | `pveAreaName` | `回调透传` | [NetPve.as:74](as3/scripts/net/pixvi/myr/net/NetPve.as#L74) |
|
||||
| `pveService/queryPVEInfo` | 查询 PVE 活动信息 | `无显式业务字段` | `pveInfo` | [NetPve.as:90](as3/scripts/net/pixvi/myr/net/NetPve.as#L90) |
|
||||
| `pveService/startPVE` | 开始 PVE 活动挑战 | `pveAreaName` | `回调透传` | [NetPve.as:39](as3/scripts/net/pixvi/myr/net/NetPve.as#L39) |
|
||||
|
||||
### 牧场事件(NetRandomEvent)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `gameEventService/finishFarmEvent` | 完成牧场随机事件 | `无显式业务字段` | `getTasks, result, unlockTasks` | [NetRandomEvent.as:46](as3/scripts/net/pixvi/myr/net/NetRandomEvent.as#L46) |
|
||||
| `gameEventService/getFarmEvent` | 查询牧场随机事件 | `无显式业务字段` | `currentTime, masterEventTimer, triggerEvent, typeId` | [NetRandomEvent.as:30](as3/scripts/net/pixvi/myr/net/NetRandomEvent.as#L30) |
|
||||
|
||||
### 排行榜(NetRank)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `rankService/queryRank` | 查询排行榜 | `rankName` | `回调透传` | [NetRank.as:26](as3/scripts/net/pixvi/myr/net/NetRank.as#L26) |
|
||||
|
||||
### 牧场建造(NetRoom)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `roomService/roomCreateByKe` | 用氪金建造牧场 | `无显式业务字段` | `room` | [NetRoom.as:60](as3/scripts/net/pixvi/myr/net/NetRoom.as#L60) |
|
||||
| `roomService/roomCreateByMoney` | 用金币建造牧场 | `无显式业务字段` | `room` | [NetRoom.as:56](as3/scripts/net/pixvi/myr/net/NetRoom.as#L56) |
|
||||
| `roomService/roomUpgrade` | 升级牧场 | `roomId, targetTypeId, useVoucher` | `room` | [NetRoom.as:38](as3/scripts/net/pixvi/myr/net/NetRoom.as#L38) |
|
||||
|
||||
### 商店(NetShop)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `shopService/shopItemBuy` | 购买商店物品 | `shopId, shopType, num` | `costKe, costMoney, items` | [NetShop.as:41](as3/scripts/net/pixvi/myr/net/NetShop.as#L41) |
|
||||
| `shopService/shopQuery` | 查询商店商品 | `无显式业务字段` | `keShopList, moneyShopList, shopBuyNum` | [NetShop.as:57](as3/scripts/net/pixvi/myr/net/NetShop.as#L57) |
|
||||
|
||||
### 皮肤(NetSkin)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterSetSkin` | 设置魔物皮肤 | `monsterId, skinType` | `回调透传` | [NetSkin.as:29](as3/scripts/net/pixvi/myr/net/NetSkin.as#L29) |
|
||||
|
||||
### 培育室(NetStack)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterSell` | 派遣/出售魔物 | `monsterId` | `money` | [NetStack.as:137](as3/scripts/net/pixvi/myr/net/NetStack.as#L137) |
|
||||
| `stackService/stackAddMonster` | 向培育槽放入魔物蛋 | `eggs` | `monsters` | [NetStack.as:90](as3/scripts/net/pixvi/myr/net/NetStack.as#L90) |
|
||||
| `stackService/stackCheckProcess` | 推进/检查培育成长阶段 | `无显式业务字段` | `allExp, datas, stackMonsterInfos` | [NetStack.as:121](as3/scripts/net/pixvi/myr/net/NetStack.as#L121) |
|
||||
| `stackService/stackGrowthNumber` | 增加培育槽属性加成次数 | `stackId, name` | `回调透传` | [NetStack.as:55](as3/scripts/net/pixvi/myr/net/NetStack.as#L55) |
|
||||
| `stackService/stackOpen` | 开启培育槽 | `openType, position` | `stack` | [NetStack.as:74](as3/scripts/net/pixvi/myr/net/NetStack.as#L74) |
|
||||
| `stackService/stackSpeedUp` | 加速培育 | `monsterId, num` | `startTime` | [NetStack.as:162](as3/scripts/net/pixvi/myr/net/NetStack.as#L162) |
|
||||
| `stackService/stackTransferMonster` | 从培育槽收取魔物到牧场 | `datas` | `此回调未显式读取字段` | [NetStack.as:106](as3/scripts/net/pixvi/myr/net/NetStack.as#L106) |
|
||||
|
||||
### 冒险关卡与结算(NetStage)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `battleService/battleEnd` | 提交普通关卡战斗数据并结算 | `battleData` | `costTi, lockStage, monsterExpInfos, reward, unlockStage` | [NetStage.as:89](as3/scripts/net/pixvi/myr/net/NetStage.as#L89) |
|
||||
| `loopStageService/checkNextWeek` | 检查循环关卡跨周更新 | `无显式业务字段` | `回调透传` | [NetStage.as:54](as3/scripts/net/pixvi/myr/net/NetStage.as#L54) |
|
||||
| `loopStageService/getStageReward` | 领取循环关卡阶段奖励 | `rewardId` | `回调透传` | [NetStage.as:38](as3/scripts/net/pixvi/myr/net/NetStage.as#L38) |
|
||||
| `stageService/stageStart` | 进入指定关卡和难度 | `stageTypeId, stageLevel` | `stageEvent, triggerEvent` | [NetStage.as:73](as3/scripts/net/pixvi/myr/net/NetStage.as#L73) |
|
||||
|
||||
### 配置、公告与时间(NetSystem)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `gameService/queryGameConfig` | 查询游戏配置 | `无显式业务字段` | `config` | [NetSystem.as:115](as3/scripts/net/pixvi/myr/net/NetSystem.as#L115) |
|
||||
| `gameService/queryGameNotice` | 查询公告 | `无显式业务字段` | `gameNotice` | [NetSystem.as:91](as3/scripts/net/pixvi/myr/net/NetSystem.as#L91) |
|
||||
| `getSysCurTime/execute` | 查询系统时间 | `无显式业务字段` | `time` | [NetSystem.as:44](as3/scripts/net/pixvi/myr/net/NetSystem.as#L44) |
|
||||
| `userServerService/firstOpenGame` | 上报首次启动 | `os, osType, phoneScreen, phoneFactory, phoneModel, channel, isp, network, deviceId, imei, tjChannel` | `此回调未显式读取字段` | [NetSystem.as:76](as3/scripts/net/pixvi/myr/net/NetSystem.as#L76) |
|
||||
|
||||
### 任务与委托(NetTask)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `taskService/taskComplete` | 完成任务并领取奖励 | `taskId, taskTypeId` | `nextTasks, reward, unlockStages, unlockTasks` | [NetTask.as:94](as3/scripts/net/pixvi/myr/net/NetTask.as#L94) |
|
||||
| `taskService/taskCompleteStep` | 推进任务当前步骤 | `taskId, removeIds, taskTypeId, battleData` | `reward, stageReward` | [NetTask.as:70](as3/scripts/net/pixvi/myr/net/NetTask.as#L70) |
|
||||
| `taskService/taskLoopFlush` | 刷新每日循环委托 | `无显式业务字段` | `loopTask` | [NetTask.as:110](as3/scripts/net/pixvi/myr/net/NetTask.as#L110) |
|
||||
| `taskService/taskLoopReceive` | 接取指定城市的循环委托 | `taskTypeId, city` | `task` | [NetTask.as:129](as3/scripts/net/pixvi/myr/net/NetTask.as#L129) |
|
||||
| `taskService/taskReceive` | 接取普通任务 | `taskTypeId` | `task` | [NetTask.as:46](as3/scripts/net/pixvi/myr/net/NetTask.as#L46) |
|
||||
| `taskService/taskUpdate` | 更新任务状态/解锁 | `unlockTasks, receiveTasks, removeTasks` | `receiveTasks, unlockTasks` | [NetTask.as:149](as3/scripts/net/pixvi/myr/net/NetTask.as#L149) |
|
||||
|
||||
### 战斗编队(NetTeam)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `monsterService/monsterPlaceBattleTeam` | 将魔物加入战斗队伍 | `monsterId, battleTeamName, position` | `此回调未显式读取字段` | [NetTeam.as:34](as3/scripts/net/pixvi/myr/net/NetTeam.as#L34) |
|
||||
| `monsterService/monsterWithdrawBattleTeam` | 从战斗队伍移除魔物 | `battleTeamName, position` | `此回调未显式读取字段` | [NetTeam.as:53](as3/scripts/net/pixvi/myr/net/NetTeam.as#L53) |
|
||||
|
||||
### 登录、区服与实名(NetUser)
|
||||
|
||||
| API | 用途 | 请求字段 | 回调读取字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| `userInfoService/userActive` | 提交激活码 | `activeCode` | `回调透传` | [NetUser.as:205](as3/scripts/net/pixvi/myr/net/NetUser.as#L205) |
|
||||
| `userInfoService/userRegister` | 客户端保留的游戏用户注册路径 | `userName, passWord` | `回调透传` | [NetUser.as:104](as3/scripts/net/pixvi/myr/net/NetUser.as#L104) |
|
||||
| `userServerService/enterGame` | 选择区服并进入游戏 | `serverId, deviceId, network, isp, imei, tjChannel, random, osType` | `回调透传` | [NetUser.as:140](as3/scripts/net/pixvi/myr/net/NetUser.as#L140) |
|
||||
| `userServerService/loginUser` | 用渠道会话登录中心并取得区服/角色列表;另有开发模式调用 | `sdkUid, sdkToken, deviceId, channel, platform, loginType, imei, osType, tjChannel, network, isp` | `回调透传` | [NetUser.as:86](as3/scripts/net/pixvi/myr/net/NetUser.as#L86) |
|
||||
| `userServerService/loginUser` | 客户端保留的开发模式登录(loginType=dev);辅助不使用此模式 | `channel, platform, loginType, password, sdkUid, network, isp, tjChannel` | `回调透传` | [NetUser.as:188](as3/scripts/net/pixvi/myr/net/NetUser.as#L188) |
|
||||
| `userServerService/userCertification` | 提交游戏侧实名信息 | `userName, idCard` | `回调透传` | [NetUser.as:56](as3/scripts/net/pixvi/myr/net/NetUser.as#L56) |
|
||||
|
||||
## 第一弹渠道 SDK(已导出的 UserNetwork2 类)
|
||||
|
||||
SDK 方法号对应 Volley 的 GET/POST/PUT/DELETE。共享 URL 的不同方法/参数分别列出。
|
||||
绑定调用额外含混淆常量 `d.p` 对应的字段,未在本清单猜测其原名。
|
||||
|
||||
| 方法 | URL 表达式 | 用途 | 显式表单字段 | 代码位置 |
|
||||
|---|---|---|---|---|
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/reallogin"` | 账号密码登录 | `account, password` | [com.diyidan.game.network.UserNetwork2.java:21](sdk_login/com.diyidan.game.network.UserNetwork2.java#L21) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/register"` | 手机号注册 | `nickName, mobile, password, smsCode, userSource` | [com.diyidan.game.network.UserNetwork2.java:36](sdk_login/com.diyidan.game.network.UserNetwork2.java#L36) |
|
||||
| PUT | `"https://gameapi.diyidan.net/g0.3/users/register"` | 游客升级手机号账号 | `mobile, password, smsCode` | [com.diyidan.game.network.UserNetwork2.java:47](sdk_login/com.diyidan.game.network.UserNetwork2.java#L47) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/register"` | 游客注册 | `deviceId` | [com.diyidan.game.network.UserNetwork2.java:53](sdk_login/com.diyidan.game.network.UserNetwork2.java#L53) |
|
||||
| DELETE | `"https://gameapi.diyidan.net/g0.3/users/reallogin"` | 退出渠道会话 | `无显式表单字段` | [com.diyidan.game.network.UserNetwork2.java:57](sdk_login/com.diyidan.game.network.UserNetwork2.java#L57) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/reallogin"` | 使用第一弹 Token 登录 | `token` | [com.diyidan.game.network.UserNetwork2.java:66](sdk_login/com.diyidan.game.network.UserNetwork2.java#L66) |
|
||||
| GET | `"https://gameapi.diyidan.net/g0.3/users/realtoken"` | 使用永久 Token 获取会话 | `无显式表单字段` | [com.diyidan.game.network.UserNetwork2.java:73](sdk_login/com.diyidan.game.network.UserNetwork2.java#L73) |
|
||||
| GET | `"https://gameapi.diyidan.net/g0.3/users/realtoken"` | 验证 Token | `无显式表单字段` | [com.diyidan.game.network.UserNetwork2.java:80](sdk_login/com.diyidan.game.network.UserNetwork2.java#L80) |
|
||||
| GET | `"https://gameapi.diyidan.net/g0.3/users/realtoken?duration=" + j` | 生成指定有效期 Token | `无显式表单字段` | [com.diyidan.game.network.UserNetwork2.java:87](sdk_login/com.diyidan.game.network.UserNetwork2.java#L87) |
|
||||
| PUT | `"https://gameapi.diyidan.net/g0.3/users/realforgetpass"` | 短信验证后重设密码 | `mobile, newPass, smsCode` | [com.diyidan.game.network.UserNetwork2.java:98](sdk_login/com.diyidan.game.network.UserNetwork2.java#L98) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/reallogin"` | 通过 Token 绑定已有账号 | `token` | [com.diyidan.game.network.UserNetwork2.java:108](sdk_login/com.diyidan.game.network.UserNetwork2.java#L108) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/reallogin"` | 通过密码绑定已有账号 | `account, password` | [com.diyidan.game.network.UserNetwork2.java:116](sdk_login/com.diyidan.game.network.UserNetwork2.java#L116) |
|
||||
| POST | `"https://gameapi.diyidan.net/g0.3/users/real"` | 渠道侧实名验证 | `user_real_name, user_ID_card` | [com.diyidan.game.network.UserNetwork2.java:123](sdk_login/com.diyidan.game.network.UserNetwork2.java#L123) |
|
||||
|
||||
账号密码接口的 SDK 查询参数含 `versionCode`、`buildNumber`、`appChannel`,请求头有应用身份签名与设备字段。
|
||||
Token 校验类方法还涉及 SDK 自身的 Header/会话状态,不能把表内空表单理解为无需认证。
|
||||
|
||||
## 范围和待确认项
|
||||
|
||||
- 本清单检查 31 个网络类的字符串及常量请求。此前 `endpoints.json` 的 111 路径未覆盖 `pay-server/...` 前缀,本次补入 5 条。
|
||||
- `monsterService/monsterPotential` 只找到常量声明,未在此范围找到调用,不能视为已确认可用的 API。
|
||||
- `NetMonster.addPotential` 实际向 `monsterTranster2Room` 发送潜能参数;清单保留该反编译事实,不改写成猜测的路径。
|
||||
- 参数集合是静态分支的并集,不表示每次都必填。嵌套对象、服务端默认值、类型约束需要逐个联调。
|
||||
- 同一个接口可能被多个包装方法调用;CSV/JSON 保留这些变体,因此行数可能大于唯一接口数。
|
||||
- 未恢复服务端源代码、完整数据库结构、服务端验签/战斗校验规则。未对库存、支付等路径进行官方实服测试。
|
||||
- 动态拼接、其他未导出渠道 SDK、热更新资源或其他版本新增 API 不在当前静态覆盖范围。
|
||||
@@ -0,0 +1,72 @@
|
||||
# 战斗检查规则与现有 V4 的对应关系
|
||||
|
||||
2026-11-07。检查对象为 1.9.68 留存反编译代码和现有伤害 V4 包内主程序。
|
||||
以下是客户端静态规则,不是服务端完整反作弊规则或处罚阈值。
|
||||
|
||||
## 当前 V4 能确认的结论
|
||||
|
||||
V4 的玩家(team 1)攻击敌方(team 2)路径,在所有 `onHurt` 控制器处理后、
|
||||
扣血前,将局部最终伤害变为 `int(Math.min(damage * 10, 50000))`。
|
||||
后面的 `damage > 80000 && checkCheat` 检查仍然存在。
|
||||
因此,对确实经过这段 V4 修改且输入伤害非负的命中,检查时的伤害不超过 50000,
|
||||
不会满足这一条超过 80000 的条件。这不是“全部检测都不会触发”的证明。
|
||||
|
||||
不经过该修改的路径,例如没有攻击者对象的环境伤害、敌方攻击等,保留原行为。
|
||||
V4 伤害版没有将角色属性和技能参数翻倍;它也没有清除异常记录或修改结算上报函数。
|
||||
倍率是否生效与是否能被服务端识别是不同问题;用户已确认倍率生效,没有实证确认不可识别。
|
||||
|
||||
## 源码中的条件
|
||||
|
||||
| 检查 | 源码实际条件 | 计数变化 / 记录 | 位置 |
|
||||
|---|---|---|---|
|
||||
| 单次伤害 | `damage > 80000 && checkCheat` | `cheatNum += 10`,`overdamage`,保存伤害及攻击者信息 | `BattleMon.as:953` |
|
||||
| 我方治疗 | `team == 1 && hp > 20000`,该 `hp` 是治疗量 | 实际 `+=19`,文字标记为 `+15overcure`;二者不一致,不能只看标记猜计数 | `BattleMon.as:616` |
|
||||
| 死亡异常 | 死亡处理时 `getTotalHurtRecort() == 0` | `+=1000`,`cheatDead` | `BattleGround.as:1087` |
|
||||
| 数值配置 | 某个 `Table.game_setting` 数值与资源原值之差绝对值 `>0.001` | 每个差异 `+=41`,记录原值及当前值 | `BattlePanel.as:341` |
|
||||
| 技能参数 | 主/副技能中被检查的非数组参数与资源原值不相等 | 每个差异 `+=41`,`skillTable` | `BattlePanel.as:355` |
|
||||
| 好感度 | 被检查的玩家魔物 `feel > 200` | 实际 `+=50`,文字为 `+15overfeel` | `BattlePanel.as:390` |
|
||||
| 基础属性表 | 角色所用的 atk/def/dex/hp 基础表值与资源原表不相等 | `+=15`,`overbase` | `BattlePanel.as:397` |
|
||||
| 成长属性上界 | `当前属性 > 原表基础值 + 原表最大成长 × (等级 + potentialLevel) × 4` | `+=25`,文字为 `+15overgrow` | `BattlePanel.as:402` |
|
||||
| 潜能属性上界 | `potential_属性 > (配置基础潜能 + 配置每级增量 × tplevel) × 1.5` | `+=30`,文字为 `+15overpoten` | `BattlePanel.as:406` |
|
||||
| 等级 | `level > GameMath.getMonMaxLevel(potentialLevel)` | `+=50`,`overlv` | `BattlePanel.as:416` |
|
||||
| 战斗属性与基准 | atk、def、dex、最大 HP、当前 HP 中任意一项超过重新构造的角色基准 `×1.5` | 这一组条件满足时 `+=20` | `BattleMonVo.as:540` |
|
||||
| 其他战斗参数与基准 | crit、atkVim、sunFire、skillCooldown、atkPoi、atkStun、atkPoiDmg 中任意一项超过相应基准 `×1.5` | 这一组条件满足时再 `+=20` | `BattleMonVo.as:554` |
|
||||
| BOSS 伤害 | BOSS 模式中记录伤害超过该 BOSS `maxDamage ×1.2` | 此处只 `addRecord`,没有增加 `cheatNum` | `BattlePanel.as:351` |
|
||||
|
||||
细节:
|
||||
|
||||
- `beHurt` 检查的是计算出的 `damage`,不是敌人因为剩余 HP 较少而实际损失的 `realDamage`。
|
||||
没有最终上限时,原伤害 9000 乘十得到 90000,会满足伤害条件;现有 V4 在此路径最终为 50000。
|
||||
- 属性表/成长/潜能/好感/等级检查对召唤物、场景物和部分特殊编号有条件排除;
|
||||
`checkCheat` 的两组比较是在该魔物检查块中调用。
|
||||
- 源码标为 `BattleModeType.PVE` 的模式会对 HP 比较加入 `pveHpScale`,并在表属性循环中移除 HP。
|
||||
不把这个模式常量泛指为所有普通冒险。
|
||||
- 技能检查对部分技能有显式例外:主技能排除 223/57/229,副技能排除 223/57,数组参数不逐项比较。
|
||||
- 等级上限函数返回 `potentialLevel * Table.potential_info.potentialLevelMaxAdd`,本清单不把它误当固定常数。
|
||||
- 上面的数字是客户端累加分值,不是封号门槛;未拿到服务端如何使用这些值的实现。
|
||||
|
||||
## 上报过程
|
||||
|
||||
`BattlePanel.battleCompleteHandler` 调用 `cheatCheck()`。当 `cheatNum > 0`,
|
||||
会补充角色记录;`BattleData.getObj()` 此时将 `cheatRecords` 编码成 JSON 字符串。
|
||||
如果 `cheatNum == 0`,该方法把 `cheatRecords` 设为空字符串。
|
||||
因此单独的 BOSS 文本记录不等价于它一定被传出,必须结合最终计数判断。
|
||||
|
||||
普通关卡通过 `battleService/battleEnd` 发送 `battleData`,还包含胜负、击杀、剩余时间、
|
||||
伤害、存活/死亡数、AP 和参战阵容等。`cheatNum == 0` 不能证明服务端没有其他检查。
|
||||
|
||||
## 实物核对
|
||||
|
||||
- V4 APK 的 `assets/MYRMain.app` 与本次审查文件 `analysis/MYRMain_damage_v4.app` 字节一致。
|
||||
- 该主程序 SHA-256:`9fb3c5c6f55ba3ac657b460dfe0691e7437bc7a4547de5e0c91db563d56652bb`。
|
||||
- `VerifySwfPatch` 确认倍率和 50000 上限存在,且位于控制器处理之后。
|
||||
- `AuditBattleBytecode` 检查受影响方法的分支/栈结构通过;这不是完整游戏运行测试。
|
||||
- 对原始主程序和 V4 逐字节比较以下方法,全部未改变:
|
||||
`BattlePanel.cheatCheck`、`BattleMonVo.checkCheat`、`BattleData.getObj`、
|
||||
`BattleMon.beCure`、`BattleGround.deadHandler`、`NetStage.finishStageBattle`。
|
||||
- V4 `beHurt` 的导出字节码中,上限位于 `0x02a7`,原有伤害阈值检查位于 `0x058e`,
|
||||
使用同一局部伤害变量。导出在 `bytecode_audit/MYRMain_damage_v4.app.beHurt.txt`。
|
||||
- 比较工具:`tools/CompareBattleChecks.java`。本次只解析本地文件,没有联网测试结算。
|
||||
|
||||
热更新实际加载的其他代码、原生层和服务端规则没有在此次审查中得到完整覆盖。
|
||||
不能从这些已知规则推导出保证“检测不出”的倍率或安装包。
|
||||
@@ -0,0 +1,115 @@
|
||||
# Local battle diagnostic builds V3
|
||||
|
||||
Superseded for testing by the damage-only [V4 cache fix](BATTLE_V4.md).
|
||||
V3 preserved the original AIR extraction-cache ID, allowing already extracted
|
||||
program files to survive an in-place installation. APK asset identity alone
|
||||
does not establish what AIR executed.
|
||||
|
||||
Date: 2026-11-07. User reported both previous modifications had no effect.
|
||||
The private-server prototype is outside this work.
|
||||
|
||||
## Confirmed defects in the previous builds
|
||||
|
||||
`tools/AuditBattleBytecode.java` traverses reachable instructions, checks operand
|
||||
and scope stack heights, stack merges, declared limits and branch destinations.
|
||||
The original methods pass. The previous builds fail as follows:
|
||||
|
||||
- `MYRMain_player_stats_x2.app`, `TeamCenter.getBattleTeamVo`, method 12,
|
||||
body 11: stack underflow at method byte offset 268 (`0x10c`), `pop` on an
|
||||
empty stack after the inserted HP assignments.
|
||||
- `MYRDyd_packaged_main.swf`, `MYRLoaderStarter.fixComplete`, method 44,
|
||||
body 43: reachable stack height 5 exceeds `max_stack=4` at method offsets
|
||||
`0x2b` and `0x32`. The old patch overwrote `setlocal1` and left the
|
||||
`updateFiles` value on the stack. The branch destination remains valid.
|
||||
|
||||
These are bytecode defects, independently of APK signatures or readable
|
||||
decompiler output. They have not been established as the sole cause of the
|
||||
reported behavior through an Android execution trace.
|
||||
|
||||
Read-only ADB checks established that the installed APK matched the previous
|
||||
stats build and that the game process was not running during inspection.
|
||||
No installation, uninstallation or application-data clearing was performed.
|
||||
|
||||
## New builds
|
||||
|
||||
- Damage variant: player team 1 attacking enemy team 2, after hurt controllers
|
||||
and before HP deduction: `int(Math.min(damage * 10, 50000))`.
|
||||
Environmental damage without an attacking unit and enemy attacks retain
|
||||
their original behavior. Zero damage remains zero.
|
||||
- Stats variant: double the player battle copy's attack, defense, dexterity,
|
||||
current/max HP, crit, self heal, lifesteal, attack/defense stun, poison chance
|
||||
and damage, cooldown modifier, sun fire, moon heal, death explosion and
|
||||
thorns. The separate damage multiplier is absent. Speed, range, level,
|
||||
skill IDs/levels, AP costs and persistent character records are unchanged.
|
||||
- Both variants use a loader created from the original loader. Its 20-byte
|
||||
assignment block now obtains
|
||||
`File.applicationDirectory.resolvePath("MYRMain.app").url` directly.
|
||||
Only 18 bytes change; file length, all branch/exception offsets and method
|
||||
signatures remain unchanged. No storage or update files are deleted by
|
||||
this patch; existing resource-update behavior elsewhere is retained.
|
||||
|
||||
`SurgicalBattlePatch.java` adds actual instructions to original methods,
|
||||
rebuilds branch offsets from instruction identities, retains signatures,
|
||||
and copies all other SWF tags byte for byte. It does not import a complete
|
||||
decompiler P-code listing. The loader patch is separately guarded by the
|
||||
original SWF SHA-256 and an exact original-byte assertion.
|
||||
|
||||
## Visible runtime checks
|
||||
|
||||
A small green status overlay is attached to the stage. It ignores touches.
|
||||
The status has these stages:
|
||||
|
||||
1. `LOCAL D10 V3` or `LOCAL S2 V3`, then `WAITING FOR LOCAL BATTLE`:
|
||||
the instrumented main startup method has executed.
|
||||
2. `ENTRY ATK=... DEF=... DEX=... HP=.../...`:
|
||||
the player battle-copy creation path has executed. With several party
|
||||
members, the last processed member is displayed. Character menus show
|
||||
persistent records and are not a reliable check of this battle-copy patch.
|
||||
3. In the damage variant, `HIT 123 -> 1230 (PLAYER > ENEMY)` is an example
|
||||
of the pre/post values printed by the actual patched hurt path. Values
|
||||
reaching the cap instead display a final value of 50000. This is computed
|
||||
damage; HP actually lost may be smaller if the enemy has less HP left.
|
||||
|
||||
Test one variant at a time in an ordinary adventure battle. Fully exit and
|
||||
relaunch the app after installing an update. Resource updates are not needed
|
||||
to activate these packaged-code changes. If the overlay is absent, or stays
|
||||
at a particular stage, report that stage or capture the screen so the next
|
||||
probe can focus on the loading/startup/battle path concerned.
|
||||
|
||||
These builds use the same local test signing certificate as the previous
|
||||
modified builds. Installing on the device remains a separate user action.
|
||||
Do not uninstall or clear application data to resolve a signature error.
|
||||
|
||||
## Validation and limits
|
||||
|
||||
- Original methods pass the structural bytecode audit; the two old defects
|
||||
fail it; all V3 target methods pass it after serialization and re-reading.
|
||||
- `TestBattleFragment` executes instructions read from each final SWF using
|
||||
FFDec's arithmetic/branch implementation with property and display stubs.
|
||||
Twenty damage cases cover both teams, null attacker, zero, the cap, integer
|
||||
overflow, and an available/absent overlay. Thirty-four stat assertions
|
||||
cover all modified fields including fractional modifiers and HP/max HP.
|
||||
- These are fragment tests and structural checks, not the full Android AIR
|
||||
verifier or a gameplay test. Actual loading, displayed numbers and battle
|
||||
outcomes still need an on-device test of V3.
|
||||
- `compare_swf_v3.py` verifies tag count/order and exact preservation of every
|
||||
unmodified SWF tag. Only startup, team and (damage variant) hurt ABC tags
|
||||
may change. The loader changes only its original merged ABC tag.
|
||||
- `build_battle_v3.py` checks original APK identity, repacks both SWFs, aligns,
|
||||
signs, verifies signatures and all ZIP CRCs, and asserts that only the two
|
||||
intended non-signature APK members changed. The resulting hashes and
|
||||
paths are recorded in `analysis/battle_v3_manifest.json` when it completes.
|
||||
|
||||
## Reproduce
|
||||
|
||||
```powershell
|
||||
javac -encoding UTF-8 -cp 'tools\ffdec\lib\*' -d analysis\build tools\AuditBattleBytecode.java tools\SurgicalBattlePatch.java tools\TestBattleFragment.java
|
||||
java -Xmx2g -cp 'analysis\build;tools\ffdec\lib\*' SurgicalBattlePatch analysis\MYRMain.app analysis\MYRMain_damage_v3.app damage
|
||||
java -Xmx2g -cp 'analysis\build;tools\ffdec\lib\*' SurgicalBattlePatch analysis\MYRMain.app analysis\MYRMain_stats_v3.app stats
|
||||
python tools\patch_loader_v3.py analysis\MYRDyd.swf analysis\MYRDyd_v3.swf
|
||||
java -Xmx2g -cp 'analysis\build;tools\ffdec\lib\*' AuditBattleBytecode analysis\MYRDyd_v3.swf analysis\MYRMain_damage_v3.app analysis\MYRMain_stats_v3.app
|
||||
java -Xmx2g -cp 'analysis\build;tools\ffdec\lib\*' TestBattleFragment analysis\MYRMain_damage_v3.app damage
|
||||
java -Xmx2g -cp 'analysis\build;tools\ffdec\lib\*' TestBattleFragment analysis\MYRMain_stats_v3.app stats
|
||||
python tools\compare_swf_v3.py
|
||||
python tools\build_battle_v3.py
|
||||
```
|
||||
@@ -0,0 +1,71 @@
|
||||
# Damage-only build V4: refresh the AIR extracted-code cache
|
||||
|
||||
Follow-up: the user confirmed that V4's damage multiplier works. The focused
|
||||
rule audit in [BATTLE_RULES.md](BATTLE_RULES.md) verifies the final 50000 cap and
|
||||
unchanged check/report methods; this does not establish server-side acceptance
|
||||
or undetectability.
|
||||
|
||||
2026-11-07. Only the damage variant is built in this follow-up.
|
||||
|
||||
## Evidence and diagnosis
|
||||
|
||||
Read-only inspection of the installed APK found the V3 stats assets intact:
|
||||
see `device_latest_identity.json`. This establishes installed package content,
|
||||
not which extracted files AIR executed. The user reports no startup overlay.
|
||||
|
||||
The APK's actual Android AIR runtime was decompiled from `classes.dex` using
|
||||
the existing local JADX library. In
|
||||
`air_runtime/com.adobe.air.ApplicationFileManager.java`:
|
||||
|
||||
- `readFileName` returns immediately if the extracted asset already exists.
|
||||
It does not compare that file with the new APK's contents or CRC.
|
||||
- `processAndroidDataPath` selects an extraction directory using the launch
|
||||
activity's `uniqueappversionid` metadata.
|
||||
- `RefreshAppCache` leaves an existing directory with that ID untouched;
|
||||
a new ID follows AIR's normal extraction-cache refresh path.
|
||||
|
||||
The original and all previous modifications retained
|
||||
`978ba13e-4b54-44d5-ae53-24335a039748`. This was an omitted build input and
|
||||
provides a concrete explanation for intact APK patches failing to execute
|
||||
after an in-place update. The private extracted cache was not read, so its
|
||||
actual contents have not been independently confirmed on the device.
|
||||
The few-MB game update could also contain code, but no update payload was
|
||||
captured; its contents are not inferred from its size.
|
||||
|
||||
## Change
|
||||
|
||||
V4 keeps only player-to-enemy damage x10, capped at 50000, and the repaired
|
||||
packaged-main loader. The display marker reads `LOCAL D10 V4`.
|
||||
|
||||
The compiled Android manifest's AIR cache ID changes to
|
||||
`1c639d6a-e893-598e-8156-2f372d453d3f`. The replacement UUID has the same
|
||||
encoded length; the binary XML layout stays intact. Package ID, app version,
|
||||
permissions and entrypoint remain unchanged. The new ID makes AIR refresh
|
||||
its extracted program assets using its existing runtime code. This is not
|
||||
an uninstall or application-data-clear operation.
|
||||
|
||||
Besides regenerated signatures, only `AndroidManifest.xml`,
|
||||
`assets/MYRDyd.swf`, and `assets/MYRMain.app` change.
|
||||
|
||||
## Validation and device test
|
||||
|
||||
The serialized SWF passes control-flow/stack checks and all 20 damage-fragment
|
||||
cases. The build additionally validates the compiled manifest with `aapt`,
|
||||
ZIP CRCs, package contents, alignment, and APK signatures. The manifest dump
|
||||
is saved as `v4_manifest_dump.txt`; build identity goes in
|
||||
`battle_v4_manifest.json`.
|
||||
|
||||
Install the V4 damage package over the current locally signed build and fully
|
||||
relaunch. The expected startup overlay is `LOCAL D10 V4`. In an ordinary
|
||||
adventure battle it should progress from `ENTRY ...` to `HIT ... -> ...`.
|
||||
An enemy with less HP remaining may lose less than the computed damage.
|
||||
Do not clear app data or uninstall to test this cache fix.
|
||||
|
||||
The build process does not install or launch the app. Actual V4 behavior
|
||||
remains unverified until the on-device test.
|
||||
|
||||
```powershell
|
||||
javac -encoding UTF-8 -cp 'tools\ffdec\lib\*;analysis\build' -d analysis\build tools\SurgicalBattlePatch.java
|
||||
java -Xmx1g -cp 'analysis\build;tools\ffdec\lib\*' SurgicalBattlePatch analysis\MYRMain.app analysis\MYRMain_damage_v4.app damage V4
|
||||
python tools\build_battle_v3.py --mode damage --revision V4 --refresh-air-cache
|
||||
```
|
||||
@@ -0,0 +1,729 @@
|
||||
body
|
||||
maxstack 7
|
||||
localcount 30
|
||||
initscopedepth 0
|
||||
maxscopedepth 1
|
||||
|
||||
code
|
||||
getlocal0
|
||||
pushscope
|
||||
debugfile "D:\\SynchroSpace\\SynologyDrive\\NetSynchroDisk\\yunProject\\develop\\MYRProject\\src1.01;net\\pixvi\\myr\\battle\\view;BattleMon.as"
|
||||
debug 1, "checkCheat", 11, 0
|
||||
debug 1, "damage", 13, 0
|
||||
debug 1, "iscounter", 14, 0
|
||||
debug 1, "flashTime", 10, 0
|
||||
debug 1, "con", 15, 0
|
||||
debug 1, "isCrit", 4, 0
|
||||
debug 1, "enemy", 1, 0
|
||||
debug 1, "m", 16, 0
|
||||
debug 1, "flashColor", 9, 0
|
||||
debug 1, "backai", 17, 0
|
||||
debug 1, "realAtk", 3, 0
|
||||
debug 1, "powX", 6, 0
|
||||
debug 1, "para", 18, 0
|
||||
debug 1, "powY", 7, 0
|
||||
debug 1, "jumpNum", 12, 0
|
||||
debug 1, "realDamage", 19, 0
|
||||
debug 1, "record", 20, 0
|
||||
debug 1, "atk", 2, 0
|
||||
debug 1, "pow", 5, 0
|
||||
debug 1, "from", 0, 0
|
||||
debug 1, "autoFixPow", 8, 0
|
||||
debug 1, "fe", 21, 0
|
||||
debug 1, "effectmov2", 22, 0
|
||||
pushnull
|
||||
setlocal 19
|
||||
pushfalse
|
||||
setlocal 18
|
||||
pushnull
|
||||
setlocal 21
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 922
|
||||
getproperty QName(PackageNamespace(""),"dead")
|
||||
iffalse ofs00a5
|
||||
pushbyte 0
|
||||
returnvalue
|
||||
ofs00a5:
|
||||
getlocal2
|
||||
debugline 923
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs00d5
|
||||
getlocal 7
|
||||
debugline 924
|
||||
pushbyte -1
|
||||
equals
|
||||
iffalse ofs00c3
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
convert_d
|
||||
setlocal 7
|
||||
ofs00c3:
|
||||
getlocal 8
|
||||
debugline 925
|
||||
pushbyte -1
|
||||
equals
|
||||
iffalse ofs00d5
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"y")
|
||||
convert_d
|
||||
setlocal 8
|
||||
ofs00d5:
|
||||
getlocal2
|
||||
debugline 928
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs00ea
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"faceJump")
|
||||
callproperty QName(PackageNamespace(""),"jump"), 0
|
||||
convert_b
|
||||
ofs00ea:
|
||||
dup
|
||||
iffalse ofs00fd
|
||||
pop
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs00fd:
|
||||
dup
|
||||
iffalse ofs010c
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
pushdouble 0.28
|
||||
lessthan
|
||||
convert_b
|
||||
ofs010c:
|
||||
iffalse ofs0119
|
||||
findpropstrict QName(PackageNamespace(""),"showFace")
|
||||
pushbyte 9
|
||||
callpropvoid QName(PackageNamespace(""),"showFace"), 1
|
||||
ofs0119:
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 930
|
||||
getproperty QName(PackageNamespace(""),"attack")
|
||||
getproperty QName(PackageNamespace(""),"shotter")
|
||||
dup
|
||||
iffalse ofs0134
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
equals
|
||||
convert_b
|
||||
ofs0134:
|
||||
iffalse ofs0141
|
||||
findpropstrict QName(PackageNamespace(""),"showFace")
|
||||
pushbyte 4
|
||||
callpropvoid QName(PackageNamespace(""),"showFace"), 1
|
||||
ofs0141:
|
||||
getlex QName(PackageNamespace(""),"ui")
|
||||
debugline 932
|
||||
callproperty QName(PackageNamespace(""),"showHpSomeTime"), 0
|
||||
pop
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect")
|
||||
getlocal 11
|
||||
getlocal 10
|
||||
debugline 935
|
||||
pushdouble 0.9
|
||||
constructprop QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect"), 3
|
||||
coerce QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect")
|
||||
setlocal 22
|
||||
getlocal 22
|
||||
getlex QName(PackageNamespace(""),"monMov")
|
||||
debugline 936
|
||||
callproperty QName(PackageNamespace(""),"startEffect"), 1
|
||||
pop
|
||||
debugline 940
|
||||
pushfalse
|
||||
convert_b
|
||||
setlocal 15
|
||||
getlocal2
|
||||
debugline 941
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs018b
|
||||
pop
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
callproperty QName(PackageNamespace(""),"counter"), 1
|
||||
convert_b
|
||||
ofs018b:
|
||||
iffalse ofs01a2
|
||||
getlocal3
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
debugline 942
|
||||
getproperty QName(PackageNamespace(""),"counterAdd")
|
||||
multiply
|
||||
convert_i
|
||||
setlocal3
|
||||
debugline 943
|
||||
pushtrue
|
||||
convert_b
|
||||
setlocal 15
|
||||
ofs01a2:
|
||||
getlocal3
|
||||
debugline 947
|
||||
setlocal 14
|
||||
getlocal 4
|
||||
debugline 949
|
||||
not
|
||||
iffalse ofs01f1
|
||||
getlocal2
|
||||
debugline 950
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
debugline 950
|
||||
iffalse ofs01dd
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
getlocal3
|
||||
getlocal2
|
||||
debugline 951
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dex")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dex")
|
||||
getlex QName(PackageNamespace(""),"all_def")
|
||||
callproperty QName(PackageNamespace(""),"damage"), 4
|
||||
convert_i
|
||||
setlocal 14
|
||||
jump ofs01f1
|
||||
ofs01dd:
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
getlocal3
|
||||
debugline 953
|
||||
pushbyte 10
|
||||
pushbyte 10
|
||||
getlex QName(PackageNamespace(""),"all_def")
|
||||
callproperty QName(PackageNamespace(""),"damage"), 4
|
||||
convert_i
|
||||
setlocal 14
|
||||
ofs01f1:
|
||||
getlocal 14
|
||||
debugline 958
|
||||
pushbyte 1
|
||||
getlex QName(PackageNamespace(""),"all_defdama")
|
||||
subtract
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
debugline 961
|
||||
pushbyte 1
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"defDama")
|
||||
subtract
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
debugline 962
|
||||
pushbyte 0
|
||||
lessthan
|
||||
iffalse ofs0225
|
||||
debugline 963
|
||||
pushbyte 0
|
||||
convert_i
|
||||
setlocal 14
|
||||
ofs0225:
|
||||
pushbyte 0
|
||||
setlocal 25
|
||||
getlex QName(PackageNamespace(""),"controllers")
|
||||
setlocal 24
|
||||
jump ofs0279
|
||||
ofs0231:
|
||||
label
|
||||
getlocal 24
|
||||
getlocal 25
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.element.battle.moncontroller"),"BaseMonController")
|
||||
setlocal 16
|
||||
getlocal 16
|
||||
debugline 969
|
||||
getproperty QName(PackageNamespace(""),"openHurt")
|
||||
iffalse ofs0279
|
||||
getlocal 16
|
||||
getlocal3
|
||||
getlocal2
|
||||
debugline 970
|
||||
callproperty QName(PackageNamespace(""),"onHurt"), 2
|
||||
coerce QName(PackageNamespace(""),"Object")
|
||||
setlocal 19
|
||||
getlocal 19
|
||||
debugline 971
|
||||
getproperty Multiname("damage",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 19
|
||||
debugline 972
|
||||
getproperty Multiname("iscount",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs0279
|
||||
getlocal 19
|
||||
getproperty Multiname("iscount",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
convert_b
|
||||
setlocal 15
|
||||
ofs0279:
|
||||
hasnext2 24, 25
|
||||
iftrue ofs0231
|
||||
getlocal2
|
||||
pushnull
|
||||
equals
|
||||
iffalse ofsPLAYERCHECK
|
||||
jump ofsNODAMAGEBOOST
|
||||
ofsPLAYERCHECK:
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
pushbyte 1
|
||||
equals
|
||||
dup
|
||||
iffalse ofsNODAMAGEBOOSTPOP
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"team")
|
||||
pushbyte 2
|
||||
equals
|
||||
iffalse ofsNODAMAGEBOOST
|
||||
getlocal 14
|
||||
pushbyte 10
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
pushint 50000
|
||||
ifle ofsNODAMAGEBOOST
|
||||
pushint 50000
|
||||
setlocal 14
|
||||
jump ofsNODAMAGEBOOST
|
||||
ofsNODAMAGEBOOSTPOP:
|
||||
pop
|
||||
ofsNODAMAGEBOOST:
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 977
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 14
|
||||
lessthan
|
||||
iffalse ofs0298
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
jump ofs029b
|
||||
ofs0298:
|
||||
getlocal 14
|
||||
convert_i
|
||||
ofs029b:
|
||||
convert_i
|
||||
setlocal 20
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 978
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 14
|
||||
subtract
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"hp")
|
||||
findpropstrict QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
debugline 980
|
||||
dup
|
||||
getproperty QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
getlocal 14
|
||||
add
|
||||
setproperty QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 982
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
pushbyte 0
|
||||
lessequals
|
||||
iffalse ofs02d8
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 983
|
||||
pushbyte 0
|
||||
setproperty QName(PackageNamespace(""),"hp")
|
||||
ofs02d8:
|
||||
findpropstrict QName(PackageNamespace(""),"updateHpBar")
|
||||
debugline 985
|
||||
callpropvoid QName(PackageNamespace(""),"updateHpBar"), 0
|
||||
getlocal 13
|
||||
iffalse ofs030c
|
||||
findpropstrict QName(PackageNamespace(""),"hitNumJump")
|
||||
getlocal 14
|
||||
getlocal 7
|
||||
getlocal0
|
||||
debugline 993
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
greaterthan
|
||||
iffalse ofs0301
|
||||
pushbyte -1
|
||||
jump ofs0304
|
||||
ofs0301:
|
||||
pushbyte 1
|
||||
convert_d
|
||||
ofs0304:
|
||||
getlocal 5
|
||||
getlocal 15
|
||||
callpropvoid QName(PackageNamespace(""),"hitNumJump"), 4
|
||||
ofs030c:
|
||||
findpropstrict QName(PackageNamespace(""),"dispatchEvent")
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.pfw.event"),"PiEvent")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.event"),"BattleEvent")
|
||||
debugline 998
|
||||
getproperty QName(PackageNamespace(""),"MONSTER_BE_HURT")
|
||||
pushstring "damage"
|
||||
convert_s
|
||||
getlocal 20
|
||||
newobject 1
|
||||
constructprop QName(PackageNamespace("net.pixvi.pfw.event"),"PiEvent"), 2
|
||||
callpropvoid QName(PackageNamespace(""),"dispatchEvent"), 1
|
||||
findpropstrict QName(PackageNamespace(""),"checkDead")
|
||||
debugline 999
|
||||
callpropvoid QName(PackageNamespace(""),"checkDead"), 0
|
||||
debugline 1002
|
||||
getlocal 6
|
||||
getlex QName(PackageNamespace(""),"all_powdef")
|
||||
subtract
|
||||
convert_d
|
||||
setlocal 6
|
||||
findpropstrict QName(PackageNamespace(""),"givePow")
|
||||
getlocal 6
|
||||
getlocal 7
|
||||
getlocal 8
|
||||
getlocal 9
|
||||
debugline 1003
|
||||
callpropvoid QName(PackageNamespace(""),"givePow"), 4
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 1007
|
||||
getproperty QName(PackageNamespace(""),"moveImmune")
|
||||
not
|
||||
dup
|
||||
iffalse ofs0368
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dead")
|
||||
not
|
||||
convert_b
|
||||
ofs0368:
|
||||
dup
|
||||
iffalse ofs0376
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"ai")
|
||||
pushbyte 2
|
||||
greaterequals
|
||||
convert_b
|
||||
ofs0376:
|
||||
dup
|
||||
iffalse ofs038b
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
divide
|
||||
pushdouble 0.2
|
||||
lessthan
|
||||
convert_b
|
||||
ofs038b:
|
||||
iffalse ofs0509
|
||||
debugline 1009
|
||||
pushfalse
|
||||
convert_b
|
||||
setlocal 18
|
||||
pushbyte 0
|
||||
setlocal 27
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1010
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"monsters")
|
||||
setlocal 26
|
||||
jump ofs0405
|
||||
ofs03b0:
|
||||
label
|
||||
getlocal 26
|
||||
getlocal 27
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.battle.view"),"BattleMon")
|
||||
setlocal 17
|
||||
getlocal 17
|
||||
debugline 1013
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
equals
|
||||
dup
|
||||
iffalse ofs03df
|
||||
pop
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
divide
|
||||
pushdouble 0.3
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs03df:
|
||||
dup
|
||||
iffalse ofs03fa
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"Math")
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
subtract
|
||||
callproperty QName(PackageNamespace(""),"abs"), 1
|
||||
pushbyte 120
|
||||
lessthan
|
||||
convert_b
|
||||
ofs03fa:
|
||||
iffalse ofs0405
|
||||
debugline 1014
|
||||
pushtrue
|
||||
convert_b
|
||||
setlocal 18
|
||||
ofs0405:
|
||||
hasnext2 26, 27
|
||||
iftrue ofs03b0
|
||||
getlocal 18
|
||||
dup
|
||||
iffalse ofs041c
|
||||
pop
|
||||
getlocal2
|
||||
debugline 1018
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
convert_b
|
||||
ofs041c:
|
||||
iffalse ofs0509
|
||||
findpropstrict QName(PackageNamespace("flash.geom"),"Point")
|
||||
getlocal0
|
||||
debugline 1019
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
lessthan
|
||||
iffalse ofs043d
|
||||
pushbyte 1
|
||||
jump ofs0440
|
||||
ofs043d:
|
||||
pushbyte -1
|
||||
convert_d
|
||||
ofs0440:
|
||||
getlex QName(PackageNamespace("net.pixvi.pfw.utils"),"Random")
|
||||
pushbyte 60
|
||||
pushbyte 120
|
||||
callproperty QName(PackageNamespace(""),"integer"), 2
|
||||
multiply
|
||||
add
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"y")
|
||||
constructprop QName(PackageNamespace("flash.geom"),"Point"), 2
|
||||
findproperty QName(PackageNamespace(""),"targetPoint")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
debugline 1020
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
lessthan
|
||||
iffalse ofs049c
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1021
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
setproperty QName(PackageNamespace(""),"x")
|
||||
ofs049c:
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
debugline 1023
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("h",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
add
|
||||
greaterthan
|
||||
iffalse ofs0509
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1024
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("h",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
add
|
||||
setproperty QName(PackageNamespace(""),"x")
|
||||
ofs0509:
|
||||
findpropstrict QName(PackageNamespace(""),"dispatchEvent")
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.myr.event"),"MYREvent")
|
||||
getlex QName(PackageNamespace(""),"BE_HURT")
|
||||
debugline 1028
|
||||
pushstring "enemy"
|
||||
convert_s
|
||||
getlocal2
|
||||
pushstring "damage"
|
||||
convert_s
|
||||
getlocal 14
|
||||
newobject 2
|
||||
constructprop QName(PackageNamespace("net.pixvi.myr.event"),"MYREvent"), 2
|
||||
callpropvoid QName(PackageNamespace(""),"dispatchEvent"), 1
|
||||
getlocal 14
|
||||
debugline 1030
|
||||
pushint 80000
|
||||
greaterthan
|
||||
dup
|
||||
iffalse ofs053b
|
||||
pop
|
||||
getlocal 12
|
||||
convert_b
|
||||
ofs053b:
|
||||
iffalse ofs05b5
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1031
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatNum")
|
||||
pushbyte 10
|
||||
add
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1031
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"cheatNum")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1032
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatRecords")
|
||||
pushstring "+10overdamage"
|
||||
callproperty QName(PackageNamespace(""),"addRecord"), 1
|
||||
pop
|
||||
debugline 1033
|
||||
pushstring "from"
|
||||
convert_s
|
||||
getlocal1
|
||||
pushstring "dmg"
|
||||
convert_s
|
||||
getlocal 14
|
||||
pushstring "hurtTeam"
|
||||
convert_s
|
||||
getlex QName(PackageNamespace(""),"team")
|
||||
newobject 3
|
||||
coerce QName(PackageNamespace(""),"Object")
|
||||
setlocal 21
|
||||
getlocal2
|
||||
debugline 1034
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs05a0
|
||||
getlocal 21
|
||||
getlocal2
|
||||
debugline 1035
|
||||
getproperty QName(PackageNamespace(""),"mid")
|
||||
setproperty Multiname("mid",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
ofs05a0:
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1037
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatRecords")
|
||||
getproperty QName(PackageNamespace(""),"damages")
|
||||
getlocal 21
|
||||
callproperty QName(Namespace("http://adobe.com/AS3/2006/builtin"),"push"), 1
|
||||
pop
|
||||
ofs05b5:
|
||||
getlocal0
|
||||
debugline 1041
|
||||
getproperty QName(PackageNamespace(""),"effectMovs")
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs05cd
|
||||
pop
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"effectMovs")
|
||||
getproperty QName(PackageNamespace(""),"length")
|
||||
pushbyte 0
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs05cd:
|
||||
iffalse ofs060a
|
||||
pushbyte 0
|
||||
setlocal 29
|
||||
getlex QName(PackageNamespace(""),"effectMovs")
|
||||
setlocal 28
|
||||
jump ofs0603
|
||||
ofs05dd:
|
||||
label
|
||||
getlocal 28
|
||||
getlocal 29
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.battle.view.effectmov"),"BaseMonEffectMov")
|
||||
setlocal 23
|
||||
getlocal 23
|
||||
debugline 1043
|
||||
getproperty QName(PackageNamespace(""),"type")
|
||||
pushstring "defence"
|
||||
equals
|
||||
iffalse ofs0603
|
||||
getlocal 23
|
||||
getlocal0
|
||||
debugline 1044
|
||||
callproperty QName(PackageNamespace(""),"startEffect"), 1
|
||||
pop
|
||||
ofs0603:
|
||||
hasnext2 28, 29
|
||||
iftrue ofs05dd
|
||||
ofs060a:
|
||||
getlocal 14
|
||||
debugline 1049
|
||||
returnvalue
|
||||
end ; code
|
||||
end ; body
|
||||
@@ -0,0 +1,729 @@
|
||||
body
|
||||
maxstack 7
|
||||
localcount 30
|
||||
initscopedepth 0
|
||||
maxscopedepth 1
|
||||
|
||||
code
|
||||
getlocal0
|
||||
pushscope
|
||||
debugfile "D:\\SynchroSpace\\SynologyDrive\\NetSynchroDisk\\yunProject\\develop\\MYRProject\\src1.01;net\\pixvi\\myr\\battle\\view;BattleMon.as"
|
||||
debug 1, "checkCheat", 11, 0
|
||||
debug 1, "damage", 13, 0
|
||||
debug 1, "iscounter", 14, 0
|
||||
debug 1, "flashTime", 10, 0
|
||||
debug 1, "con", 15, 0
|
||||
debug 1, "isCrit", 4, 0
|
||||
debug 1, "enemy", 1, 0
|
||||
debug 1, "m", 16, 0
|
||||
debug 1, "flashColor", 9, 0
|
||||
debug 1, "backai", 17, 0
|
||||
debug 1, "realAtk", 3, 0
|
||||
debug 1, "powX", 6, 0
|
||||
debug 1, "para", 18, 0
|
||||
debug 1, "powY", 7, 0
|
||||
debug 1, "jumpNum", 12, 0
|
||||
debug 1, "realDamage", 19, 0
|
||||
debug 1, "record", 20, 0
|
||||
debug 1, "atk", 2, 0
|
||||
debug 1, "pow", 5, 0
|
||||
debug 1, "from", 0, 0
|
||||
debug 1, "autoFixPow", 8, 0
|
||||
debug 1, "fe", 21, 0
|
||||
debug 1, "effectmov2", 22, 0
|
||||
pushnull
|
||||
setlocal 19
|
||||
pushfalse
|
||||
setlocal 18
|
||||
pushnull
|
||||
setlocal 21
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 922
|
||||
getproperty QName(PackageNamespace(""),"dead")
|
||||
iffalse ofs00a5
|
||||
pushbyte 0
|
||||
returnvalue
|
||||
ofs00a5:
|
||||
getlocal2
|
||||
debugline 923
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs00d5
|
||||
getlocal 7
|
||||
debugline 924
|
||||
pushbyte -1
|
||||
equals
|
||||
iffalse ofs00c3
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
convert_d
|
||||
setlocal 7
|
||||
ofs00c3:
|
||||
getlocal 8
|
||||
debugline 925
|
||||
pushbyte -1
|
||||
equals
|
||||
iffalse ofs00d5
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"y")
|
||||
convert_d
|
||||
setlocal 8
|
||||
ofs00d5:
|
||||
getlocal2
|
||||
debugline 928
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs00ea
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"faceJump")
|
||||
callproperty QName(PackageNamespace(""),"jump"), 0
|
||||
convert_b
|
||||
ofs00ea:
|
||||
dup
|
||||
iffalse ofs00fd
|
||||
pop
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs00fd:
|
||||
dup
|
||||
iffalse ofs010c
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpPercent")
|
||||
pushdouble 0.28
|
||||
lessthan
|
||||
convert_b
|
||||
ofs010c:
|
||||
iffalse ofs0119
|
||||
findpropstrict QName(PackageNamespace(""),"showFace")
|
||||
pushbyte 9
|
||||
callpropvoid QName(PackageNamespace(""),"showFace"), 1
|
||||
ofs0119:
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 930
|
||||
getproperty QName(PackageNamespace(""),"attack")
|
||||
getproperty QName(PackageNamespace(""),"shotter")
|
||||
dup
|
||||
iffalse ofs0134
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
equals
|
||||
convert_b
|
||||
ofs0134:
|
||||
iffalse ofs0141
|
||||
findpropstrict QName(PackageNamespace(""),"showFace")
|
||||
pushbyte 4
|
||||
callpropvoid QName(PackageNamespace(""),"showFace"), 1
|
||||
ofs0141:
|
||||
getlex QName(PackageNamespace(""),"ui")
|
||||
debugline 932
|
||||
callproperty QName(PackageNamespace(""),"showHpSomeTime"), 0
|
||||
pop
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect")
|
||||
getlocal 11
|
||||
getlocal 10
|
||||
debugline 935
|
||||
pushdouble 0.9
|
||||
constructprop QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect"), 3
|
||||
coerce QName(PackageNamespace("net.pixvi.common.effect.effects"),"FlashEffect")
|
||||
setlocal 22
|
||||
getlocal 22
|
||||
getlex QName(PackageNamespace(""),"monMov")
|
||||
debugline 936
|
||||
callproperty QName(PackageNamespace(""),"startEffect"), 1
|
||||
pop
|
||||
debugline 940
|
||||
pushfalse
|
||||
convert_b
|
||||
setlocal 15
|
||||
getlocal2
|
||||
debugline 941
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs018b
|
||||
pop
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
callproperty QName(PackageNamespace(""),"counter"), 1
|
||||
convert_b
|
||||
ofs018b:
|
||||
iffalse ofs01a2
|
||||
getlocal3
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
debugline 942
|
||||
getproperty QName(PackageNamespace(""),"counterAdd")
|
||||
multiply
|
||||
convert_i
|
||||
setlocal3
|
||||
debugline 943
|
||||
pushtrue
|
||||
convert_b
|
||||
setlocal 15
|
||||
ofs01a2:
|
||||
getlocal3
|
||||
debugline 947
|
||||
setlocal 14
|
||||
getlocal 4
|
||||
debugline 949
|
||||
not
|
||||
iffalse ofs01f1
|
||||
getlocal2
|
||||
debugline 950
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
debugline 950
|
||||
iffalse ofs01dd
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
getlocal3
|
||||
getlocal2
|
||||
debugline 951
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dex")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dex")
|
||||
getlex QName(PackageNamespace(""),"all_def")
|
||||
callproperty QName(PackageNamespace(""),"damage"), 4
|
||||
convert_i
|
||||
setlocal 14
|
||||
jump ofs01f1
|
||||
ofs01dd:
|
||||
getlex QName(PackageNamespace("net.pixvi.myr"),"GameMath")
|
||||
getlocal3
|
||||
debugline 953
|
||||
pushbyte 10
|
||||
pushbyte 10
|
||||
getlex QName(PackageNamespace(""),"all_def")
|
||||
callproperty QName(PackageNamespace(""),"damage"), 4
|
||||
convert_i
|
||||
setlocal 14
|
||||
ofs01f1:
|
||||
getlocal 14
|
||||
debugline 958
|
||||
pushbyte 1
|
||||
getlex QName(PackageNamespace(""),"all_defdama")
|
||||
subtract
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
debugline 961
|
||||
pushbyte 1
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"defDama")
|
||||
subtract
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
debugline 962
|
||||
pushbyte 0
|
||||
lessthan
|
||||
iffalse ofs0225
|
||||
debugline 963
|
||||
pushbyte 0
|
||||
convert_i
|
||||
setlocal 14
|
||||
ofs0225:
|
||||
pushbyte 0
|
||||
setlocal 25
|
||||
getlex QName(PackageNamespace(""),"controllers")
|
||||
setlocal 24
|
||||
jump ofs0279
|
||||
ofs0231:
|
||||
label
|
||||
getlocal 24
|
||||
getlocal 25
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.element.battle.moncontroller"),"BaseMonController")
|
||||
setlocal 16
|
||||
getlocal 16
|
||||
debugline 969
|
||||
getproperty QName(PackageNamespace(""),"openHurt")
|
||||
iffalse ofs0279
|
||||
getlocal 16
|
||||
getlocal3
|
||||
getlocal2
|
||||
debugline 970
|
||||
callproperty QName(PackageNamespace(""),"onHurt"), 2
|
||||
coerce QName(PackageNamespace(""),"Object")
|
||||
setlocal 19
|
||||
getlocal 19
|
||||
debugline 971
|
||||
getproperty Multiname("damage",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 19
|
||||
debugline 972
|
||||
getproperty Multiname("iscount",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs0279
|
||||
getlocal 19
|
||||
getproperty Multiname("iscount",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
convert_b
|
||||
setlocal 15
|
||||
ofs0279:
|
||||
hasnext2 24, 25
|
||||
iftrue ofs0231
|
||||
getlocal2
|
||||
pushnull
|
||||
equals
|
||||
iffalse ofsPLAYERCHECK
|
||||
jump ofsNODAMAGEBOOST
|
||||
ofsPLAYERCHECK:
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
pushbyte 1
|
||||
equals
|
||||
dup
|
||||
iffalse ofsNODAMAGEBOOSTPOP
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"team")
|
||||
pushbyte 2
|
||||
equals
|
||||
iffalse ofsNODAMAGEBOOST
|
||||
getlocal 14
|
||||
pushbyte 10
|
||||
multiply
|
||||
convert_i
|
||||
setlocal 14
|
||||
getlocal 14
|
||||
pushint 50000
|
||||
ifle ofsNODAMAGEBOOST
|
||||
pushint 50000
|
||||
setlocal 14
|
||||
jump ofsNODAMAGEBOOST
|
||||
ofsNODAMAGEBOOSTPOP:
|
||||
pop
|
||||
ofsNODAMAGEBOOST:
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 977
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 14
|
||||
lessthan
|
||||
iffalse ofs0298
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
jump ofs029b
|
||||
ofs0298:
|
||||
getlocal 14
|
||||
convert_i
|
||||
ofs029b:
|
||||
convert_i
|
||||
setlocal 20
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 978
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 14
|
||||
subtract
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"hp")
|
||||
findpropstrict QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
debugline 980
|
||||
dup
|
||||
getproperty QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
getlocal 14
|
||||
add
|
||||
setproperty QName(PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),"totalHurtRecort")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 982
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
pushbyte 0
|
||||
lessequals
|
||||
iffalse ofs02d8
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 983
|
||||
pushbyte 0
|
||||
setproperty QName(PackageNamespace(""),"hp")
|
||||
ofs02d8:
|
||||
findpropstrict QName(PackageNamespace(""),"updateHpBar")
|
||||
debugline 985
|
||||
callpropvoid QName(PackageNamespace(""),"updateHpBar"), 0
|
||||
getlocal 13
|
||||
iffalse ofs030c
|
||||
findpropstrict QName(PackageNamespace(""),"hitNumJump")
|
||||
getlocal 14
|
||||
getlocal 7
|
||||
getlocal0
|
||||
debugline 993
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
greaterthan
|
||||
iffalse ofs0301
|
||||
pushbyte -1
|
||||
jump ofs0304
|
||||
ofs0301:
|
||||
pushbyte 1
|
||||
convert_d
|
||||
ofs0304:
|
||||
getlocal 5
|
||||
getlocal 15
|
||||
callpropvoid QName(PackageNamespace(""),"hitNumJump"), 4
|
||||
ofs030c:
|
||||
findpropstrict QName(PackageNamespace(""),"dispatchEvent")
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.pfw.event"),"PiEvent")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.event"),"BattleEvent")
|
||||
debugline 998
|
||||
getproperty QName(PackageNamespace(""),"MONSTER_BE_HURT")
|
||||
pushstring "damage"
|
||||
convert_s
|
||||
getlocal 20
|
||||
newobject 1
|
||||
constructprop QName(PackageNamespace("net.pixvi.pfw.event"),"PiEvent"), 2
|
||||
callpropvoid QName(PackageNamespace(""),"dispatchEvent"), 1
|
||||
findpropstrict QName(PackageNamespace(""),"checkDead")
|
||||
debugline 999
|
||||
callpropvoid QName(PackageNamespace(""),"checkDead"), 0
|
||||
debugline 1002
|
||||
getlocal 6
|
||||
getlex QName(PackageNamespace(""),"all_powdef")
|
||||
subtract
|
||||
convert_d
|
||||
setlocal 6
|
||||
findpropstrict QName(PackageNamespace(""),"givePow")
|
||||
getlocal 6
|
||||
getlocal 7
|
||||
getlocal 8
|
||||
getlocal 9
|
||||
debugline 1003
|
||||
callpropvoid QName(PackageNamespace(""),"givePow"), 4
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
debugline 1007
|
||||
getproperty QName(PackageNamespace(""),"moveImmune")
|
||||
not
|
||||
dup
|
||||
iffalse ofs0368
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"dead")
|
||||
not
|
||||
convert_b
|
||||
ofs0368:
|
||||
dup
|
||||
iffalse ofs0376
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"ai")
|
||||
pushbyte 2
|
||||
greaterequals
|
||||
convert_b
|
||||
ofs0376:
|
||||
dup
|
||||
iffalse ofs038b
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlex QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
divide
|
||||
pushdouble 0.2
|
||||
lessthan
|
||||
convert_b
|
||||
ofs038b:
|
||||
iffalse ofs0509
|
||||
debugline 1009
|
||||
pushfalse
|
||||
convert_b
|
||||
setlocal 18
|
||||
pushbyte 0
|
||||
setlocal 27
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1010
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"monsters")
|
||||
setlocal 26
|
||||
jump ofs0405
|
||||
ofs03b0:
|
||||
label
|
||||
getlocal 26
|
||||
getlocal 27
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.battle.view"),"BattleMon")
|
||||
setlocal 17
|
||||
getlocal 17
|
||||
debugline 1013
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"team")
|
||||
equals
|
||||
dup
|
||||
iffalse ofs03df
|
||||
pop
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"monVo")
|
||||
getproperty QName(PackageNamespace(""),"hpMax")
|
||||
divide
|
||||
pushdouble 0.3
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs03df:
|
||||
dup
|
||||
iffalse ofs03fa
|
||||
pop
|
||||
getlex QName(PackageNamespace(""),"Math")
|
||||
getlocal 17
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
subtract
|
||||
callproperty QName(PackageNamespace(""),"abs"), 1
|
||||
pushbyte 120
|
||||
lessthan
|
||||
convert_b
|
||||
ofs03fa:
|
||||
iffalse ofs0405
|
||||
debugline 1014
|
||||
pushtrue
|
||||
convert_b
|
||||
setlocal 18
|
||||
ofs0405:
|
||||
hasnext2 26, 27
|
||||
iftrue ofs03b0
|
||||
getlocal 18
|
||||
dup
|
||||
iffalse ofs041c
|
||||
pop
|
||||
getlocal2
|
||||
debugline 1018
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
convert_b
|
||||
ofs041c:
|
||||
iffalse ofs0509
|
||||
findpropstrict QName(PackageNamespace("flash.geom"),"Point")
|
||||
getlocal0
|
||||
debugline 1019
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal2
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
lessthan
|
||||
iffalse ofs043d
|
||||
pushbyte 1
|
||||
jump ofs0440
|
||||
ofs043d:
|
||||
pushbyte -1
|
||||
convert_d
|
||||
ofs0440:
|
||||
getlex QName(PackageNamespace("net.pixvi.pfw.utils"),"Random")
|
||||
pushbyte 60
|
||||
pushbyte 120
|
||||
callproperty QName(PackageNamespace(""),"integer"), 2
|
||||
multiply
|
||||
add
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"y")
|
||||
constructprop QName(PackageNamespace("flash.geom"),"Point"), 2
|
||||
findproperty QName(PackageNamespace(""),"targetPoint")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
debugline 1020
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
lessthan
|
||||
iffalse ofs049c
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1021
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
setproperty QName(PackageNamespace(""),"x")
|
||||
ofs049c:
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
debugline 1023
|
||||
getproperty QName(PackageNamespace(""),"x")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("h",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
add
|
||||
greaterthan
|
||||
iffalse ofs0509
|
||||
getlex QName(PackageNamespace(""),"targetPoint")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1024
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("x",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"ground")
|
||||
getproperty QName(PackageNamespace(""),"vo")
|
||||
getproperty QName(PackageNamespace(""),"mapAreas")
|
||||
getproperty Multiname("area_battlefield",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getproperty Multiname("h",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
add
|
||||
setproperty QName(PackageNamespace(""),"x")
|
||||
ofs0509:
|
||||
findpropstrict QName(PackageNamespace(""),"dispatchEvent")
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.myr.event"),"MYREvent")
|
||||
getlex QName(PackageNamespace(""),"BE_HURT")
|
||||
debugline 1028
|
||||
pushstring "enemy"
|
||||
convert_s
|
||||
getlocal2
|
||||
pushstring "damage"
|
||||
convert_s
|
||||
getlocal 14
|
||||
newobject 2
|
||||
constructprop QName(PackageNamespace("net.pixvi.myr.event"),"MYREvent"), 2
|
||||
callpropvoid QName(PackageNamespace(""),"dispatchEvent"), 1
|
||||
getlocal 14
|
||||
debugline 1030
|
||||
pushint 80000
|
||||
greaterthan
|
||||
dup
|
||||
iffalse ofs053b
|
||||
pop
|
||||
getlocal 12
|
||||
convert_b
|
||||
ofs053b:
|
||||
iffalse ofs05b5
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1031
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatNum")
|
||||
pushbyte 10
|
||||
add
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1031
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
swap
|
||||
setproperty QName(PackageNamespace(""),"cheatNum")
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1032
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatRecords")
|
||||
pushstring "+10overdamage"
|
||||
callproperty QName(PackageNamespace(""),"addRecord"), 1
|
||||
pop
|
||||
debugline 1033
|
||||
pushstring "from"
|
||||
convert_s
|
||||
getlocal1
|
||||
pushstring "dmg"
|
||||
convert_s
|
||||
getlocal 14
|
||||
pushstring "hurtTeam"
|
||||
convert_s
|
||||
getlex QName(PackageNamespace(""),"team")
|
||||
newobject 3
|
||||
coerce QName(PackageNamespace(""),"Object")
|
||||
setlocal 21
|
||||
getlocal2
|
||||
debugline 1034
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
iffalse ofs05a0
|
||||
getlocal 21
|
||||
getlocal2
|
||||
debugline 1035
|
||||
getproperty QName(PackageNamespace(""),"mid")
|
||||
setproperty Multiname("mid",[PrivateNamespace("net.pixvi.myr.battle.view:BattleMon"),ProtectedNamespace("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.battle.view:BattleMon"),StaticProtectedNs("net.pixvi.myr.view.mon:MonView"),StaticProtectedNs("net.pixvi.pfw.display:PiSprite"),StaticProtectedNs("flash.display:Sprite"),StaticProtectedNs("flash.display:DisplayObjectContainer"),StaticProtectedNs("flash.display:InteractiveObject"),StaticProtectedNs("flash.display:DisplayObject"),StaticProtectedNs("flash.events:EventDispatcher"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.battle.view"),PackageInternalNs("net.pixvi.myr.battle.view"),PrivateNamespace("FilePrivateNS:BattleMon"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
ofs05a0:
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.panel.battle"),"BattlePanel")
|
||||
debugline 1037
|
||||
getproperty QName(PackageNamespace(""),"battleData")
|
||||
getproperty QName(PackageNamespace(""),"cheatRecords")
|
||||
getproperty QName(PackageNamespace(""),"damages")
|
||||
getlocal 21
|
||||
callproperty QName(Namespace("http://adobe.com/AS3/2006/builtin"),"push"), 1
|
||||
pop
|
||||
ofs05b5:
|
||||
getlocal0
|
||||
debugline 1041
|
||||
getproperty QName(PackageNamespace(""),"effectMovs")
|
||||
pushnull
|
||||
equals
|
||||
not
|
||||
dup
|
||||
iffalse ofs05cd
|
||||
pop
|
||||
getlocal0
|
||||
getproperty QName(PackageNamespace(""),"effectMovs")
|
||||
getproperty QName(PackageNamespace(""),"length")
|
||||
pushbyte 0
|
||||
greaterthan
|
||||
convert_b
|
||||
ofs05cd:
|
||||
iffalse ofs060a
|
||||
pushbyte 0
|
||||
setlocal 29
|
||||
getlex QName(PackageNamespace(""),"effectMovs")
|
||||
setlocal 28
|
||||
jump ofs0603
|
||||
ofs05dd:
|
||||
label
|
||||
getlocal 28
|
||||
getlocal 29
|
||||
nextvalue
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.battle.view.effectmov"),"BaseMonEffectMov")
|
||||
setlocal 23
|
||||
getlocal 23
|
||||
debugline 1043
|
||||
getproperty QName(PackageNamespace(""),"type")
|
||||
pushstring "defence"
|
||||
equals
|
||||
iffalse ofs0603
|
||||
getlocal 23
|
||||
getlocal0
|
||||
debugline 1044
|
||||
callproperty QName(PackageNamespace(""),"startEffect"), 1
|
||||
pop
|
||||
ofs0603:
|
||||
hasnext2 28, 29
|
||||
iftrue ofs05dd
|
||||
ofs060a:
|
||||
getlocal 14
|
||||
debugline 1049
|
||||
returnvalue
|
||||
end ; code
|
||||
end ; body
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
||||
# 客户端鉴别与反作弊代码检查
|
||||
|
||||
检查日期:2026-11-07。范围为工作区保留的游戏 AS3、加载器 AS3,以及
|
||||
`analysis/sdk_login/` 中已经导出的渠道 SDK Java 文件。以下是静态代码观察,
|
||||
没有向官方接口发送探测请求,没有修改或绕过检测。
|
||||
|
||||
## 明确存在:战斗异常检查与结算上报
|
||||
|
||||
- `as3/scripts/net/pixvi/myr/panel/battle/BattlePanel.as:268`:战斗完成时调用 `cheatCheck()`。
|
||||
- 同文件 `:314` 起:检查配置/技能参数、魔物基础属性、成长、潜能、等级等一致性,
|
||||
将异常累计到 `battleData.cheatNum` 和 `cheatRecords`。
|
||||
- `as3/scripts/net/pixvi/myr/battle/view/BattleMon.as:955`:伤害异常记入反作弊记录。
|
||||
- `as3/scripts/net/pixvi/myr/element/battle/BattleData.as:51`:生成结算对象;有异常时序列化记录。
|
||||
- `as3/scripts/net/pixvi/myr/net/NetStage.as:89`:通过 `battleService/battleEnd` 提交 `battleData`。
|
||||
|
||||
这证明客户端存在战斗反作弊检查和上报,不证明服务端具体处罚或验证算法。
|
||||
逐项条件和现有 V4 的字节码核对见 [BATTLE_RULES.md](BATTLE_RULES.md)。
|
||||
|
||||
## 存在代码但入口被跳过:脚本账号问答
|
||||
|
||||
`as3/scripts/net/pixvi/myr/center/GameCenter.as:252` 定义 `roboCheck()`,
|
||||
后续含“疑似脚本账号”提示、脚本使用问答和本地 `autosystem.txt` 标记。
|
||||
但该入口首先执行:
|
||||
|
||||
```actionscript
|
||||
if(GameMath.ModeTrace || true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
```
|
||||
|
||||
条件恒为真,因此这份反编译版本中的该入口直接返回,后面的问答不会由它运行。
|
||||
`ServerSelectPanel.as:107` 和 `StoreGroundPanel.as:128` 虽然有调用点,仍受到该返回影响。
|
||||
问答相关方法内没有发现向服务端提交答案的调用。
|
||||
|
||||
因此应表述为“有脚本检查遗留代码,但当前这个入口不生效”,不能把它说成已启用的脚本识别系统。
|
||||
|
||||
## 请求层观察
|
||||
|
||||
`NetUser.as:71` 起的登录、`:113` 起的选服请求包含设备、渠道、平台、IMEI 等字段;
|
||||
选服还计算 `random`。`NetCenter.as:99` 起统一加入 Token 与请求编号。
|
||||
这些证明存在请求身份/参数校验信息,单凭这些字段不能断言存在专门的脚本鉴别。
|
||||
|
||||
在本次检查的网络包装层和已导出的 SDK 文件中,没有找到专门证明
|
||||
“官方游戏进程正在运行”的独立接口或证明字段,也没有找到明确以 Qt/Python
|
||||
客户端为目标的判定逻辑。已导出 SDK 中的部分 Android Build 信息用于设备标识生成,
|
||||
不能直接算作模拟器判定。
|
||||
|
||||
没有服务器源代码,未覆盖全部原生库、所有 SDK 类和之后的热更新,
|
||||
因此服务端是否另有行为分析、频率检测、设备风险判定,结论是未知。
|
||||
@@ -0,0 +1,53 @@
|
||||
# Local battle modifications
|
||||
|
||||
V3 update (2026-11-07): the builds documented below are superseded. The old
|
||||
stats patch has a reachable stack underflow and both old builds share a loader
|
||||
patch that exceeds its declared operand stack capacity. See
|
||||
[BATTLE_V3.md](BATTLE_V3.md) for repaired bytecode, diagnostic overlays and
|
||||
the limits of verification. The previous signature/archive checks did not
|
||||
establish that these methods were valid or executed successfully.
|
||||
|
||||
The supplied original APK is unchanged. Two independent packages were built;
|
||||
their changes are not combined.
|
||||
|
||||
## Deliverables
|
||||
|
||||
- `牧羊人之心_1.9.68_伤害10倍_上限5万_修正版.apk`
|
||||
- Player (team 1) attacks against enemy units (team 2): damage x10, capped at 50,000.
|
||||
- The multiplier runs after `onHurt` controllers and before HP is deducted.
|
||||
- SHA-256: `62fa3e5be9b6775a1e75dfde15dd5f48f74836163e5da6e9746222743a17962f`.
|
||||
- `牧羊人之心_1.9.68_玩家属性2倍.apk`
|
||||
- At `TeamCenter.getBattleTeamVo`, player battle-copy attack, defense, dexterity,
|
||||
current/max HP, crit, self-heal, lifesteal, stun, poison, cooldown, sun fire,
|
||||
moon heal, death explosion, and thorns values are doubled.
|
||||
- This does not apply the separate damage x10 patch. Level, AP cost, skill
|
||||
levels, and original character/save objects are unchanged.
|
||||
- SHA-256: `85f5aa7238f1054d6bec6fafe801e858c14864f9f6d1858094336db90b0f2e54`.
|
||||
|
||||
Both packages retain `air.net.pixvi.myrzx` / `1.9.68`. Their Android loader
|
||||
loads the packaged `MYRMain.app` rather than a previously updated copy in
|
||||
application storage. Other resource updates and game saves are not deleted.
|
||||
|
||||
## Verification and limits
|
||||
|
||||
- FFDec re-read the modified methods and confirmed the intended call signatures.
|
||||
- All final APK ZIP member CRC checks and `zipalign -c -p 4` passed.
|
||||
- `apksigner verify --verbose --print-certs` passed for v1, v2, and v3.
|
||||
- Apart from regenerated signature metadata, only `assets/MYRMain.app` and
|
||||
`assets/MYRDyd.swf` differ from the original.
|
||||
- No game battle was runtime-tested by the build process. Static verification
|
||||
does not guarantee server acceptance or the absence of other anti-cheat checks.
|
||||
- The old `牧羊人之心_1.9.68_伤害10倍_上限5万.apk` is not the corrected build.
|
||||
- The local signing certificate is not the publisher's certificate. An
|
||||
original-publisher installation cannot be directly updated with these builds.
|
||||
Do not uninstall or clear data without considering save backup requirements.
|
||||
|
||||
## Reproduction
|
||||
|
||||
- `analysis/PatchBattleDamage.java`: targeted body replacement with explicit
|
||||
`--damage`, `--stats`, or `--loader` mode and retained `MethodInfo` signatures.
|
||||
- `analysis/BattleMon_beHurt_original.pcode`: damage body patch.
|
||||
- `analysis/TeamCenter_player_stats_x2.pcode`: battle-stat body patch.
|
||||
- `tools/repack_apk.py`: ZIP member replacement preserving unrelated entries.
|
||||
|
||||
The local private signing key is intentionally excluded by `.gitignore`.
|
||||
@@ -0,0 +1,70 @@
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/** Checks the actual ABC method association instead of relying on name lookup. */
|
||||
public final class InspectBattlePatch {
|
||||
public static void main(String[] args) throws Exception {
|
||||
for (String arg : args) {
|
||||
System.out.println("FILE " + arg);
|
||||
try (BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Path.of(arg)))) {
|
||||
SWF swf = new SWF(in, false);
|
||||
for (ScriptPack pack : swf.getAS3Packs()) {
|
||||
String name = pack.getClassPath().toString();
|
||||
if (!name.equals("net.pixvi.myr.battle.view.BattleMon")
|
||||
&& !name.equals("net.pixvi.myr.center.TeamCenter")
|
||||
&& !name.equals("net.pixvi.myrloader.MYRLoaderStarter")) {
|
||||
continue;
|
||||
}
|
||||
ABC abc = pack.abc;
|
||||
var tag = (com.jpexs.decompiler.flash.tags.DoABC2Tag) abc.parentTag;
|
||||
System.out.println("PACK " + name + " tag=" + tag.name
|
||||
+ " tagPos=" + tag.getPos() + " bodies=" + abc.bodies.size());
|
||||
System.out.println(" originalData=" + tag.getOriginalDataLength()
|
||||
+ " modified=" + tag.isModified()
|
||||
+ " originalHash=" + java.util.HexFormat.of().formatHex(
|
||||
java.security.MessageDigest.getInstance("SHA-256").digest(tag.getOriginalData())));
|
||||
AVM2ConstantPool c = abc.constants;
|
||||
var methods = new java.util.ArrayList<TraitMethodGetterSetter>();
|
||||
for (var instance : abc.instance_info) {
|
||||
for (Trait trait : instance.instance_traits.traits) {
|
||||
if (trait instanceof TraitMethodGetterSetter tm) methods.add(tm);
|
||||
}
|
||||
}
|
||||
for (var klass : abc.class_info) {
|
||||
for (Trait trait : klass.static_traits.traits) {
|
||||
if (trait instanceof TraitMethodGetterSetter tm) methods.add(tm);
|
||||
}
|
||||
}
|
||||
for (TraitMethodGetterSetter method : methods) {
|
||||
MethodInfo info = abc.method_info.get(method.method_info);
|
||||
String methodName = c.getString(info.name_index);
|
||||
if (!methodName.equals("beHurt") && !methodName.equals("getBattleTeamVo")
|
||||
&& !methodName.equals("fixComplete")) continue;
|
||||
int index = abc.findBodyIndex(method.method_info);
|
||||
MethodBody body = abc.bodies.get(index);
|
||||
String code = body.getCode().toASMSource(abc);
|
||||
System.out.println(name + "." + methodName + " method=" + method.method_info
|
||||
+ " body=" + index + " codeBytes=" + body.getCodeBytes().length
|
||||
+ " stats=" + body.max_stack + "/" + body.max_regs
|
||||
+ " multiplies=" + count(code, "multiply")
|
||||
+ " cap=" + code.contains("pushint 50000"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int count(String text, String token) {
|
||||
return text.split(token, -1).length - 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocal0Ins;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocal2Ins;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.SetLocalIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetLexIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.NopIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushStringIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.ASM3Parser;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.pcode.MissingSymbolHandler;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.StringReader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
/** Applies a single method-body patch and retains its original signature. */
|
||||
public final class PatchBattleDamage {
|
||||
private static final MissingSymbolHandler ALLOW_NEW_CONSTANTS = new MissingSymbolHandler() {
|
||||
public boolean missingString(String value) { return true; }
|
||||
public boolean missingInt(long value) { return true; }
|
||||
public boolean missingUInt(long value) { return true; }
|
||||
public boolean missingDouble(double value) { return true; }
|
||||
public boolean missingFloat(float value) { return true; }
|
||||
public boolean missingFloat4(com.jpexs.decompiler.flash.abc.types.Float4 value) { return true; }
|
||||
public boolean missingDecimal(macromedia.asc.util.Decimal128 value) { return true; }
|
||||
};
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length != 4) {
|
||||
throw new IllegalArgumentException("Usage: PatchBattleDamage input.app body.pcode output.app --damage|--stats|--loader");
|
||||
}
|
||||
Path input = Path.of(args[0]);
|
||||
Path output = Path.of(args[2]);
|
||||
String pcode = Files.readString(Path.of(args[1]));
|
||||
|
||||
try (BufferedInputStream stream = new BufferedInputStream(Files.newInputStream(input))) {
|
||||
SWF swf = new SWF(stream, false);
|
||||
String mode = args[3];
|
||||
boolean patchLoader = "--loader".equals(mode);
|
||||
for (ScriptPack pack : swf.getAS3Packs()) {
|
||||
String scriptName = pack.getClassPath().toString();
|
||||
if (patchLoader) {
|
||||
if (!"net.pixvi.myrloader.MYRLoaderStarter".equals(scriptName)) {
|
||||
continue;
|
||||
}
|
||||
ABC abc = pack.abc;
|
||||
int bodyIndex = abc.findMethodBodyByName(
|
||||
"net.pixvi.myrloader.MYRLoaderStarter", "fixComplete");
|
||||
if (bodyIndex < 0) {
|
||||
throw new IllegalStateException("fixComplete body not found");
|
||||
}
|
||||
MethodBody body = abc.bodies.get(bodyIndex);
|
||||
AVM2ConstantPool constants = abc.constants;
|
||||
List<Integer> patchSites = new java.util.ArrayList<>();
|
||||
for (int i = 0; i < body.getCode().code.size(); i++) {
|
||||
var code = body.getCode().code;
|
||||
if (!(code.get(i).definition instanceof PushStringIns)) {
|
||||
continue;
|
||||
}
|
||||
int stringIndex = code.get(i).operands[0];
|
||||
if (!"MYRMain.app".equals(constants.getString(stringIndex))) {
|
||||
continue;
|
||||
}
|
||||
if (i < 2 || i + 3 >= code.size()
|
||||
|| !(code.get(i - 1).definition instanceof GetLexIns)
|
||||
|| (!(code.get(i + 3).definition instanceof SetLocal2Ins)
|
||||
&& !(code.get(i + 3).definition instanceof SetLocalIns))) {
|
||||
continue;
|
||||
}
|
||||
patchSites.add(i);
|
||||
}
|
||||
if (patchSites.size() != 1) {
|
||||
throw new IllegalStateException("Expected one updated-main fallback, got " + patchSites.size());
|
||||
}
|
||||
int patchSite = patchSites.get(0);
|
||||
var code = body.getCode().code;
|
||||
int stringIndex = code.get(patchSite).operands[0];
|
||||
code.set(patchSite - 2, new AVM2Instruction(code.get(patchSite - 2).getAddress(),
|
||||
new PushStringIns(), new int[]{stringIndex}));
|
||||
for (int j = patchSite - 1; j <= patchSite + 2; j++) {
|
||||
code.set(j, new AVM2Instruction(code.get(j).getAddress(),
|
||||
new NopIns(), new int[0]));
|
||||
}
|
||||
body.setCode(body.getCode());
|
||||
((Tag) abc.parentTag).setModified(true);
|
||||
try (BufferedOutputStream out = new BufferedOutputStream(Files.newOutputStream(output))) {
|
||||
swf.saveTo(out);
|
||||
}
|
||||
System.out.println("Patched loader to use packaged MYRMain.app; original signature retained");
|
||||
return;
|
||||
}
|
||||
String methodName;
|
||||
int expectedBody;
|
||||
int expectedParameters;
|
||||
if ("--stats".equals(mode)) {
|
||||
if (!"net.pixvi.myr.center.TeamCenter".equals(scriptName)) {
|
||||
continue;
|
||||
}
|
||||
methodName = "getBattleTeamVo";
|
||||
expectedBody = 11;
|
||||
expectedParameters = 1;
|
||||
} else if ("--damage".equals(mode) && "net.pixvi.myr.battle.view.BattleMon".equals(scriptName)) {
|
||||
methodName = "beHurt";
|
||||
expectedBody = 32;
|
||||
expectedParameters = 13;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
ABC abc = pack.abc;
|
||||
int bodyIndex = expectedBody;
|
||||
if (bodyIndex < 0) {
|
||||
throw new IllegalStateException("A verified body index is required for " + scriptName);
|
||||
}
|
||||
MethodBody body = abc.bodies.get(bodyIndex);
|
||||
List<Trait> traits = abc.getMethodIndexing().findMethodTraits(pack, bodyIndex);
|
||||
if (traits.size() != 1) {
|
||||
throw new IllegalStateException("Expected one " + methodName + " trait, got " + traits.size());
|
||||
}
|
||||
int methodInfoIndex = ((TraitMethodGetterSetter) traits.get(0)).method_info;
|
||||
MethodInfo signature = abc.method_info.get(methodInfoIndex);
|
||||
if (signature.param_types.length != expectedParameters) {
|
||||
throw new IllegalStateException("Unexpected " + methodName + " parameter count: "
|
||||
+ signature.param_types.length + ", method_info=" + methodInfoIndex
|
||||
+ ", body.method_info=" + body.method_info);
|
||||
}
|
||||
|
||||
// The body-only parser resets MethodInfo before reading the body.
|
||||
int[] paramTypes = signature.param_types.clone();
|
||||
int returnType = signature.ret_type;
|
||||
int nameIndex = signature.name_index;
|
||||
int flags = signature.flags;
|
||||
var optional = signature.optional.clone();
|
||||
int[] paramNames = signature.paramNames.clone();
|
||||
|
||||
// Passing the real trait makes the parser replace only the body.
|
||||
AVM2Code code = ASM3Parser.parse(abc, new StringReader(pcode), traits.get(0),
|
||||
ALLOW_NEW_CONSTANTS, body, signature);
|
||||
signature.param_types = paramTypes;
|
||||
signature.ret_type = returnType;
|
||||
signature.name_index = nameIndex;
|
||||
signature.flags = flags;
|
||||
signature.optional = optional;
|
||||
signature.paramNames = paramNames;
|
||||
body.setCode(code);
|
||||
((Tag) abc.parentTag).setModified(true);
|
||||
try (BufferedOutputStream out = new BufferedOutputStream(Files.newOutputStream(output))) {
|
||||
swf.saveTo(out);
|
||||
}
|
||||
System.out.println("Patched " + methodName + " body " + bodyIndex + "; retained "
|
||||
+ signature.param_types.length + " parameters");
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Requested script not found");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
# Native Qt ranch companion
|
||||
|
||||
Implemented in `ranch_assistant`; launch `Start_Ranch_Helper.cmd`.
|
||||
See `ranch_assistant/README.md` for login, strategies and page screenshots.
|
||||
The successful V4 combat package was not modified or rebuilt.
|
||||
|
||||
## Current workflow
|
||||
|
||||
- The compact native page is named 自动孵蛋. The backpack table has per-species
|
||||
hatch checkboxes, numeric priority, explicit dispatch/feed/keep disposition,
|
||||
reorder threshold, target stock and eligible coin market. Unchecked species
|
||||
cannot trigger hatching or buying. Zero-stock configured rules stay visible.
|
||||
No profitability heuristic chooses the disposition in the UI. The green-slime
|
||||
preset enables that species alone, priority 1, dispatch, reorder below 1 to 10,
|
||||
Lilitos market, and retains 4+ stars/A+ grades. Startup remains read-only.
|
||||
- Login is a simple 登录 page with credentials, official region selection
|
||||
and saved sessions. Server/token/key/counter controls remain internal only;
|
||||
logging continues but the debug window opens only on explicit user request.
|
||||
Native margins/spacing, tab fonts and table rows are compact; manager size is
|
||||
1100x740 with scrollable settings. Currency/stamina placement was retained.
|
||||
- The page/log split is vertically draggable, and an explicit show/hide button
|
||||
preserves logging while hidden. Size and visibility restore per role. Tests
|
||||
verify that the log can grow beyond the old fixed height and retain records.
|
||||
- Rule priorities, reorder thresholds/targets and feeding priorities use plain
|
||||
validated integer line edits, not spin buttons. Full-width 22px scrollbars
|
||||
receive their own Qt style; application/window/button styles are unchanged.
|
||||
Manual typing and actual scrollbar sizes were verified at device scale 2.
|
||||
- Market buying uses `gachaService/gachaGetEggs` with `sc_city<city>`, a bounded
|
||||
quantity, zero vouchers and balance trace info. Only known coin markets are
|
||||
eligible. Lilitos costs 100 coins per random egg in the shipped table; it does
|
||||
not guarantee a green slime. Ten-draw preference sends num=10 using the same
|
||||
endpoint; actual returned eggs/bonuses are displayed, not promised in advance.
|
||||
Per-species reorder rules, batch limit, reserved balance and per-role daily
|
||||
coin budget bound purchases. The budget is persisted before
|
||||
sending, survives restart, and is not refunded automatically on timeout.
|
||||
Real `unlockCity` ID arrays such as `["1"]` and legacy boolean maps are both
|
||||
accepted, including by recurring-task city checks.
|
||||
- Yield data has independent 1–5-star display filters. Incubation follows checked
|
||||
species rules; dispatch still follows the protection policy. Feeding
|
||||
stops at min(user target, potentialLevel * potentialLevelMaxAdd), where the
|
||||
shipped increment is 10. Unknown breakthrough information stops feeding.
|
||||
Checked recipients are served by numeric priority, advancing after a target
|
||||
reaches its cap. Monster rows/details show breakthrough, growth grades,
|
||||
reference stats, affection and named gift preferences. Reference stats omit
|
||||
equipment, entanglement and global bonuses and are labeled as such. Context
|
||||
menus provide lock/unlock and confirmed manual dispatch or feeding; manual
|
||||
operations pause automatic execution and recheck live state.
|
||||
Level caps appear in monster and feeding-target views. Quest rows now include
|
||||
reward coins and premium currency; the role summary also shows current ke.
|
||||
- Password login uses the normal DYD channel SDK endpoint recovered from the
|
||||
APK, then the game's SDK-session login. The UI lists the returned Android
|
||||
servers with existing role names. It does not assume exactly two regions.
|
||||
The selected server supplies `gameServerAddress`; the center address comes
|
||||
from the shipped configuration. Remembering the account/password is now on
|
||||
by default as requested. Passwords are stored with current-user Windows DPAPI
|
||||
in `credentials.json`, restored on restart and retained after failed login.
|
||||
Successful role reads now also save the token, protocol key and request counters
|
||||
in DPAPI-encrypted `sessions/` files. Remember-password controls are independent
|
||||
of saved sessions. Tokens are not stored in plaintext settings or debug logs.
|
||||
- `AccountsWindow` hosts independent account tabs, each with its own worker,
|
||||
engine, trace and credential/session store. The legacy first-account root is
|
||||
preserved; new accounts use `profiles/<id>/`. Role settings and captures use
|
||||
`roles/<identity>/`, including account, channel, platform, region and role in
|
||||
the identity. Switching tabs does not stop another account's monitor.
|
||||
- Saved sessions restore only after a read verifies the expected role ID.
|
||||
Automatic execution stays off. Counter high-water marks persist before each
|
||||
request, including restore requests that time out. Duplicate account-region
|
||||
connections are guarded within the manager, and workspace locks prevent
|
||||
opening a profile twice. ADB farming permits one controlling tab per device.
|
||||
- All data pages support a right-click read-only refresh in their table/blank
|
||||
area. Local catalog/capture pages refresh local files; role pages read the
|
||||
role snapshot. Pending manual refreshes queue behind an active request.
|
||||
The pasture overview now displays counts/capacity, and the summary distinguishes
|
||||
real versus demo state and shows update time and inventory counts.
|
||||
- The native debug dialog records each request, HTTP status, elapsed time,
|
||||
decoded response and errors, including the raw decoded server list before
|
||||
schema validation. Records are redacted before display or disk storage.
|
||||
The automatic log is `local_state/ranch_helper/network_debug.jsonl`.
|
||||
Password login does not open the dialog, and waits for explicit region selection
|
||||
before `enterGame`. Copy/export actions operate on redacted records.
|
||||
- The new page-screenshot tab has seven explicit ADB capture buttons. The user
|
||||
navigates to each page. Capturing pauses assistant monitoring/farming, checks
|
||||
that the game is foreground, reads the screenshot and saves it. It does not
|
||||
tap, launch or navigate the phone. No token or login is needed for capture.
|
||||
- Required samples: stage preparation and victory settlement. Optional samples:
|
||||
countdown, auto off/on, additional confirmation, defeat. No deliberate defeat
|
||||
is needed. Original PNGs and `profile.json` are grouped under
|
||||
`<active-role-directory>/capture_profiles/<serial>/<WxH>/<stage>_<level>/`.
|
||||
- After the user captures pages, the assistant can inspect those workspace
|
||||
files and call `capture.write_buttons` with reviewed regions and tap points.
|
||||
The Qt app loads the resulting `buttons.json`; it does not include a model
|
||||
that automatically understands arbitrary screenshots. Manual cropping remains
|
||||
an optional fallback. Profiles can be restored and previewed after restart.
|
||||
- Generated button configurations check source-image hashes, stage/difficulty,
|
||||
device identity and exact resolution. Victory recognition and its confirmation
|
||||
tap can use different positions. Changed samples require regenerated buttons.
|
||||
- Recurring task planning can accept eligible offers, submit explicitly allowed
|
||||
resources, advance satisfied steps and claim rewards. Needed eggs/monster
|
||||
types are reserved against ranch actions. Battles and subsequent story steps
|
||||
wait for the game; automatic navigation to each quest battle is not implemented.
|
||||
- The map view shows stage/difficulty unlock and pass records from the account
|
||||
snapshot, and can choose a normal ADB farming target. There is no claimed
|
||||
standalone instant-sweep endpoint or headless battle simulator.
|
||||
- The incubation view includes closed positions and the separate VIP slot.
|
||||
Real snapshots use monsterId=-1 for an empty slot; <=0 values now count as
|
||||
empty and negative IDs never enter the managed-monster set. Offline replay of
|
||||
the retained response now produces three hatch actions for its three non-VIP
|
||||
empty slots, where the previous planner produced none.
|
||||
- Growth synchronization now follows MonsterCenter.secondHandler and
|
||||
checkGrowUpHandler: both clock-driven phase transitions request settlement,
|
||||
and datas/stackMonsterInfos provide the authoritative mode and growth values.
|
||||
A per-monster cache prevents stale role reads from reverting that confirmed
|
||||
state; it is discarded when the main response agrees or the instance changes.
|
||||
Pending/zero growth is unknown rather than four C grades. Inventory actions
|
||||
wait for complete mature qualities. Incomplete replies are throttled instead
|
||||
of causing a request every poll. Explicit growth sync does not dispatch/feed.
|
||||
- UI phases, pending qualities, auto-execution state and exact protection reasons
|
||||
now distinguish read-only monitoring from active processing. Runtime execution
|
||||
toggles are recorded locally. The user's retained response also exposed
|
||||
roomId=null on incubator monsters: room-capacity counting now handles it.
|
||||
Replaying the mature response with the saved rules yields two protected
|
||||
collection actions and two dispatch actions, without the int(None) exception.
|
||||
- Slot and pasture pages have coin/premium expansion buttons and context menus.
|
||||
Pricing uses stack_price/room_price and actual openType=1/2 facility counts,
|
||||
as HistoryVo does, instead of stale history counters. The UI confirms cost and
|
||||
level before submitting. Fresh reads reject changed quotes, insufficient
|
||||
balances/levels, already-open positions, and ordinary VIP-slot expansion.
|
||||
Coin pasture construction unlocks from completed task 1001011, matching the
|
||||
HistoryVo getter rather than requiring a missing raw openFarmBuild field.
|
||||
|
||||
## Artifact evidence
|
||||
|
||||
- `NetStack.as`, `NetMonster.as`: incubation, growth settlement, transfer,
|
||||
dispatch and feeding payloads, including singular/plural dispatch differences.
|
||||
- `MasterCenter.as`, `MonsterCenter.as`, `StackCenter.as`, `MonsterVo.as`,
|
||||
`GameMath.as`: snapshot data, maturity, room/VIP limits, growth grades,
|
||||
sale values and feeding experience formula.
|
||||
- `MarketPanel.as:68,84`, `GachaPanel.as:302`, `GachaCenter.as:37`, `NetGacha.as`:
|
||||
market machine IDs, balances, zero-voucher coin costs and purchase payload.
|
||||
`GameMath.as:544`, `MonsterVo.as:1121` and `potential_info`: breakthrough cap.
|
||||
`tools/extract_ranch_catalog.py` now retains the nine city-market definitions
|
||||
and the two level-limit constants.
|
||||
- `StackVo.isEmpty`, `StackOpenType`, `HistoryVo`, `AddStackPanel`, `AddRoomPanel`,
|
||||
`NetStack`, `NetRoom`: <=0 empty sentinel, VIP position 3, openType-based prices,
|
||||
levels, and normal slot/pasture creation payloads. `NetMonster.setLock` and
|
||||
feeding/dispatch methods supply the manual management requests.
|
||||
- The catalog also retains monster base stats/gift preferences, referenced gift
|
||||
names, slot/pasture prices and slot total. MonsterVo's level, potential,
|
||||
affection and upStar formulas inform labeled reference stats.
|
||||
- `analysis/sdk_login/*.java`: normal SDK password endpoint
|
||||
`https://gameapi.diyidan.net/g0.3/users/reallogin`, form fields, query fields,
|
||||
application headers and returned user-session fields. SDK 407/408 stop login;
|
||||
SMS challenge UI is not implemented. `MYRStarter.as` supplies app identity.
|
||||
- `NetUser.as`: SDK-session login and server entry. Its development-only login
|
||||
is not used as ordinary channel authentication.
|
||||
- `NetTask.as`, `TaskCenter.as`, `TaskStepVo.as`, `TaskType.as`: recurring task
|
||||
acceptance, step/reward payloads, one-based server step indices and kill targets.
|
||||
- `NetStage.as`, `BattleData.as`, `BattlePanel.as`: ordinary stage start,
|
||||
local simulation and `battleEnd` containing kills, damage, time, formation
|
||||
and other fields. This is not merely a success flag. Server-side validation
|
||||
remains unknown. No sweep endpoint was found in the inspected network classes.
|
||||
- `MYRCryptor.as` and `tools/extract_ranch_catalog.py`: MD5 resource paths,
|
||||
zlib/AMF3 table decoding. Extracted 749 monsters, 1,178 stages, 78 special-stage
|
||||
entries and 83 recurring task definitions, plus rooms, server and game settings.
|
||||
|
||||
External source: [BWIKI yield comparison](https://wiki.biligame.com/myrzx/%E9%AD%94%E7%89%A9%E6%94%B6%E7%9B%8A%E8%A1%A8),
|
||||
previously accessed 2026-11-07, visible page date 2020-12-05. Its opportunity-cost
|
||||
method informs the configurable strategy; numeric values come from the APK.
|
||||
|
||||
## Validation and remaining inputs
|
||||
|
||||
88 unit/integration tests pass: local encrypted HTTP and inventory actions,
|
||||
SDK password form/headers -> two Android regions -> selected region entry ->
|
||||
snapshot, verification/limited-login stops, recurring tasks and protections,
|
||||
map unlocks per difficulty, screenshot/profile storage and invalidation, fake
|
||||
device resolution/identity gates, separate recognition/tap coordinates, and
|
||||
Qt capture buttons performing no phone taps/navigation. Tests also cover Windows
|
||||
DPAPI persistence, failed-login credential restoration, debug UI updates,
|
||||
decrypted response retention on schema failure, timeout/HTTP failure records,
|
||||
and redaction of nested secrets, previews and exception messages.
|
||||
The new coverage includes the encrypted HTTP buy -> hatch -> growth settlement
|
||||
-> dispatch -> refreshed coin balance cycle, read-only previews, purchase limits,
|
||||
unknown/premium/locked markets, raw city ID arrays, restart-persistent purchase
|
||||
accounting, timeout accounting, star filtering, reservations across split stacks,
|
||||
breakthrough caps, independent module switches, start while busy, stop during a
|
||||
read, Qt settings restoration, and visible quest premium-currency rewards.
|
||||
Growth regression tests cover the two-stage transition, authoritative qualities
|
||||
over stale reads, automatic dispatch after settlement, S-grade retention with a
|
||||
specific reason, zero/unknown qualities, no-progress throttling, explicit sync,
|
||||
UI quality updates and the nullable roomId capacity path.
|
||||
|
||||
Login follow-up: the actual retained login response contains two complete server
|
||||
objects with valid `id` fields, followed by two Fastjson-style `$ref` aliases to
|
||||
`$.servers[0]` and `$.servers[1]`. Earlier missing-key diagnosis did not account
|
||||
for these aliases. The normalizer previously rejected the third entry, so the
|
||||
successful HTTP/JSON response never reached the region selector.
|
||||
|
||||
The fix resolves references within the server array, checks chains/bounds/cycles,
|
||||
deduplicates by server ID, and joins roles using `masterInfos.serverId`.
|
||||
`masterInfos.id` remains the character ID. Original response data is not mutated
|
||||
by the normalizer; no URLs are fetched while resolving references. Conflicting
|
||||
game addresses for one server ID still stop entry. Local failures are labeled
|
||||
as such in the debug window and are not logged twice at the UI boundary.
|
||||
|
||||
Offline replay of the actual local log now yields two server IDs (1, 2), both
|
||||
matched role names, and both original game addresses. Regression tests cover
|
||||
normalization, the Qt dropdown and password -> select second server -> snapshot
|
||||
using a loopback service with the four-entry reference response. The user has
|
||||
since confirmed successful live entry and role retrieval after the signing fix.
|
||||
|
||||
Entry-signature follow-up: the user's next actual log shows successful SDK
|
||||
authentication and center login, followed by HTTP 200 with `resCode=990`,
|
||||
`resMsg=Illegal` from `enterGame`. This is a server rejection; the response
|
||||
does not identify which field failed validation. SDK UID length/value checks
|
||||
match the center's player UID; the request sequence matches the client queue.
|
||||
|
||||
Two concrete client mismatches were found and fixed. `NetUser.makeRandom`
|
||||
passes `yyMMdd` to `Paster.timestampFormat`, but
|
||||
`loader_as/scripts/net/pixvi/pfw/utils/Paster.as:86` substitutes `Date.fullYear`
|
||||
for `yy`, producing an eight-digit date. The helper previously used Python's
|
||||
two-digit `%y`; it now uses `%Y%m%d`. Also, the original APK's
|
||||
`assets/tjchannel.json` contains `taptap`, distinct from the game channel `DYD`.
|
||||
The extractor now retains that resource; SDK center login and entry send its
|
||||
tracking value rather than copying the game channel. Missing resources use
|
||||
the original client's `unknow` fallback.
|
||||
|
||||
Regression tests pin a date and verify an independent expected MD5 preimage
|
||||
using synthetic UID/token tails. The loopback login service now rejects wrong
|
||||
signatures or tracking channels with 990 before allowing role entry. The debug
|
||||
log includes a local entry-parameter summary without UID/token fragments or
|
||||
the signature preimage. The user subsequently confirmed successful login and
|
||||
role retrieval; the retained log contains successful snapshot responses.
|
||||
|
||||
Inventory-display follow-up: the successful real snapshot had
|
||||
`activityHistory.vipInfo=null`. The planner called `.get()` on that null object
|
||||
before rendering the received data. The null handling is corrected; strategy
|
||||
errors also leave fetched base data available while disabling actions. Offline
|
||||
Qt replay of the actual response now shows four incubation slots, four egg
|
||||
types, four monsters and one pasture. No real inventory action was executed.
|
||||
|
||||
Additional regression coverage verifies concurrent isolated account workers,
|
||||
restart/resume for both accounts, role-specific policy restoration, secret-free
|
||||
session ciphertext, advanced counters on timeouts, wrong-role rejection,
|
||||
right-click refresh without writes, normal heartbeat use, and closing/reopening
|
||||
fresh tabs without starting queued work after close. Heartbeats use the normal
|
||||
`heartBeatService/keepAlive` at the original `GameCenter`'s 240-second interval;
|
||||
no client-identity concealment or detection-evasion behavior was implemented.
|
||||
|
||||
The offline inventory in `API_INVENTORY.md`, `.csv` and `.json` lists 116 game
|
||||
paths (115 have send call sites; one is declaration-only), 119 call sites and
|
||||
13 SDK call variants. `tools/build_api_inventory.py` resolves local path
|
||||
constants and literal sends and checks coverage against the earlier 111-path
|
||||
index. Five payment-prefix paths were previously omitted. Sources and callback
|
||||
fields are linked; the login/entry/snapshot path has now been observed in the
|
||||
user's real logs. Other endpoint behavior remains statically inferred.
|
||||
|
||||
Native Qt was rendered offscreen with installed CJK fonts. The screenshot tab
|
||||
preview is `ranch_helper_capture_preview.png`; manager/session previews are
|
||||
`ranch_helper_multi_account_preview.png` and `ranch_helper_session_preview.png`.
|
||||
The automation preview is `ranch_helper_automation_preview.png`.
|
||||
These previews use synthetic data. The developer's tests did not send real
|
||||
credentials to official services, or execute real inventory actions/battles.
|
||||
The user's own login and snapshots are confirmed; new multi-account live use,
|
||||
inventory automation and user-triggered page samples still need integration.
|
||||
At the user's request, there was no further live device inspection/navigation
|
||||
while they were playing.
|
||||
|
||||
The activity's standalone daily-limit field remains unidentified. Farming checks
|
||||
available tickets plus a labeled local daily attempt limit, including failures
|
||||
and interruptions. This is not claimed to query the official daily quota.
|
||||
@@ -0,0 +1,181 @@
|
||||
# Supplied APK: static analysis and reconstruction boundary
|
||||
|
||||
[CLIENT_CHECKS.md](CLIENT_CHECKS.md) records the focused detection audit:
|
||||
active battle anomaly checks/reporting are present; the retained `roboCheck`
|
||||
entry returns unconditionally, and server-side script identification remains unknown.
|
||||
[BATTLE_RULES.md](BATTLE_RULES.md) details the battle conditions and verifies
|
||||
the existing V4 cap/check placement against the APK's packaged bytecode.
|
||||
|
||||
Native Qt companion: [RANCH_HELPER.md](RANCH_HELPER.md) documents incubation
|
||||
monitoring, configurable ranch actions, the recovered 749-monster catalog,
|
||||
password login with official server selection, recurring tasks, unlocked maps,
|
||||
and ADB farming. The new page-screenshot tab saves user-triggered samples for
|
||||
assistant-generated button configurations; no manual cropping is required.
|
||||
The helper now provides multiple independent account tabs, DPAPI-encrypted
|
||||
password/token persistence, role-specific policies, right-click refresh and a
|
||||
decoded request/response debug dialog with an automatic redacted log. Launch
|
||||
`Start_Ranch_Helper.cmd`. 88 local tests pass. The user confirmed live login and
|
||||
role retrieval; actual multi-account automation and inventory writes remain
|
||||
unverified. See the helper report for exact limits.
|
||||
|
||||
[API_INVENTORY.md](API_INVENTORY.md) lists 116 game-side paths (115 with send
|
||||
call sites, one declaration-only) and 13 SDK call variants, with purposes,
|
||||
request fields, callback fields and source locations; CSV and JSON are included.
|
||||
The actual login log's two complete servers plus two `$ref` aliases now normalize
|
||||
to two region options with matched role names; offline replay of that log passed.
|
||||
The later `enterGame` 990 rejection led to two verified client corrections:
|
||||
the signature date uses the full four-digit year, and the APK tracking channel
|
||||
is `taptap` while the game channel is `DYD`. The user's subsequent successful
|
||||
snapshot exposed `vipInfo=null`, which blocked rendering; that is fixed, and
|
||||
offline Qt replay shows the received incubation, eggs, monsters and pasture.
|
||||
|
||||
V4 follow-up: [BATTLE_V4.md](BATTLE_V4.md) identifies the unchanged AIR
|
||||
extraction-cache ID as an omitted build input. The new damage-only package
|
||||
refreshes that cache through AIR's normal versioned extraction path. The
|
||||
installed V3 package was inspected read-only. The user subsequently confirmed
|
||||
that the V4 damage multiplier works; no new combat APK was built for the helper.
|
||||
|
||||
Battle-patch follow-up: see [BATTLE_V3.md](BATTLE_V3.md) for the two confirmed
|
||||
bytecode defects in the previous modifications, the V3 builds and their
|
||||
visible runtime checks. V3 gameplay has not yet been verified on the device.
|
||||
|
||||
Date: 2026-11-07 (Asia/Shanghai)
|
||||
|
||||
## Scope and evidence
|
||||
|
||||
Target: `牧羊人之心_1.9.68.apk`, 1,700,248,417 bytes, SHA-256
|
||||
`01678ee3a8465d818d32cbbd94baa0d8253b04b4c57b70ebc5544ed341f1015d`.
|
||||
All ZIP member CRC checks passed. This does not verify provenance or signature
|
||||
validity. The APK was not executed and no game server was contacted.
|
||||
|
||||
The connected REA Android provider was unavailable initially because
|
||||
`REA_JADX_MCP_JAR` was not configured. The required JAR was downloaded from
|
||||
its official release and its SHA-256 matched `jadx-headless-mcp.sha256`, but
|
||||
the already-running REA server did not inherit the new environment variable.
|
||||
Consequently, the observations below about ActionScript come from local
|
||||
JPEXS FFDec 26.4.0 decompilation, not REA Evidence records. Both downloaded
|
||||
tool archives matched their published SHA-256 values.
|
||||
|
||||
`MYRMain.app` is an uncompressed FWS SWF (version 46). JPEXS exported 1,273
|
||||
classes under `net.pixvi.myr` and the selected framework/network classes to
|
||||
`analysis/as3/scripts`. Decompiled output is reconstructed source, not the
|
||||
developers' original source files or the server implementation.
|
||||
|
||||
## Direct static observations
|
||||
|
||||
- AIR application ID: `air.net.pixvi.myrzx`; version `1.9.68`; entry
|
||||
`MYRDyd.swf`; AIR namespace 50.2; portrait, GPU rendering.
|
||||
- AIR additions request `minSdkVersion=16`, `targetSdkVersion=29`.
|
||||
These are client declarations, not a runtime compatibility guarantee.
|
||||
- Archive: 22,340 entries, including 11,713 hashed files in `assets/codes`,
|
||||
8,398 JSON files, 1,876 MP3s and 204 PNGs. The two root
|
||||
`assets/data/table` files do not prove that all game configuration is local.
|
||||
- Main logic uses ActionScript/Starling and preserves package/class names and
|
||||
original developer filesystem paths in debug metadata.
|
||||
- Default center URL: `http://120.132.6.157:9099/`; resource URL:
|
||||
`http://resource.myrzx.cn/updateserver1/verFfcs/`. Runtime configuration
|
||||
can replace the center address. No claim is made that either is operational.
|
||||
- Platform Java/DEX strings include `gameapi.diyidan.net` account/payment
|
||||
endpoints. Those are separate platform services, not the ActionScript game
|
||||
API's proof of behavior.
|
||||
|
||||
## Recovered game protocol
|
||||
|
||||
See `analysis/endpoints.json` for 111 unique path strings extracted from 31
|
||||
network classes. Their presence does not prove reachability or behavior.
|
||||
|
||||
- `HttpRemote` sends a POST whose body is a single encoded string. Normal
|
||||
requests declare `application/x-www-form-urlencoded`; selected payment
|
||||
calls use `application/json;charset=UTF-8`.
|
||||
- `NetCenter.send` adds `token`, `reqid`, and retry counter `reqsid` before
|
||||
JSON serialization. `GameMath` enables normal/payment encryption by default.
|
||||
- `Crypter` performs AES-ECB with PKCS#5/7 padding and Base64 input/output.
|
||||
The default client key is embedded in `NetCenter`; resource table
|
||||
`game_setting.xyz1` may replace it. This is obfuscation, not transport
|
||||
secrecy. No key was used to contact any external system.
|
||||
- Successful JSON uses `resCode: 0`, commonly with `resMsg`. `NetCenter`
|
||||
aliases `resCode` to `re`. `408` is a login-expiry path; some other codes
|
||||
force exit. Unknown semantics should not be guessed from code numbers.
|
||||
- Login response readers require `playerInfo`, `servers`, and `masterInfos`.
|
||||
`ServerVo` reads server id/name/status, platform/channel and game/pay URLs.
|
||||
- `masterService/masterQueryDetail` returns the main role snapshot;
|
||||
`queryMasterSecondDetail` optionally supplies `data` or legacy code `997`.
|
||||
The main reader expects `master`, `history`, `activityHistory`, `stacks`,
|
||||
`alchemyStacks`, `monsters`, `items`, `exploreTeams`, `currentTasks`,
|
||||
`rooms`, `teams` and other nested structures.
|
||||
|
||||
Primary client evidence files: `analysis/as3/scripts/net/pixvi/myr/net`,
|
||||
`analysis/as3/scripts/com/hurlant/crypto/Crypter.as`,
|
||||
`analysis/as3/scripts/net/pixvi/myr/center/AccountCenter.as`, and
|
||||
`analysis/as3/scripts/net/pixvi/myr/center/MasterCenter.as`.
|
||||
|
||||
## What was built
|
||||
|
||||
`backend` contains an independent local Python/SQLite prototype implementing
|
||||
the codec and a small account/role lifecycle. Tests cover a FIPS-197 AES
|
||||
vector, Unicode codec round trip, and an encrypted HTTP account-to-snapshot
|
||||
flow. See `backend/README.md` for exact scope and limitations.
|
||||
|
||||
## Unresolved / not claimed
|
||||
|
||||
- No bit-identical APK, original build project, backend source, or complete
|
||||
playable clone was produced. Rebuilding byte-for-byte from this artifact is
|
||||
not a meaningful goal: signing, compiler/runtime versions, original sources
|
||||
and build inputs are unavailable. Repacking the same files would copy the
|
||||
artifact, not reproduce its development project.
|
||||
- The prototype has not been connected to the original client. It still lacks
|
||||
verified resource manifests, client redirect configuration, and complete
|
||||
nested response schemas. Empty snapshot arrays can fail client assumptions.
|
||||
- Reflection, dynamically loaded code, patched/update resources and runtime
|
||||
server responses remain outside this static search boundary.
|
||||
- The client contains developer-login and plaintext HTTP remnants. They are
|
||||
security observations only; no bypass or production endpoint was attempted.
|
||||
|
||||
Any redistribution, public service, or reuse of copyrighted art, music and
|
||||
code requires permission from the respective rights holders.
|
||||
|
||||
## Ranch automation update — 2026-11-07
|
||||
|
||||
The Qt helper now has an explicit 自动孵蛋 page with independent market-buy,
|
||||
hatch, dispatch, collect and feed switches, preview, monitor-only, start and stop.
|
||||
The coin preset selects the Lilitos coin market and only green-slime incubation,
|
||||
priority 1, dispatch, reorder below 1 to 10, retains 4+ stars/A+ grades and
|
||||
disables feeding. The backpack table now holds explicit per-species rules;
|
||||
unchecked eggs cannot hatch or trigger buying. Market draws
|
||||
remain random; the shipped Lilitos price is 100 coins per egg, not a guarantee
|
||||
of green-slime-only purchases or a fixed net profit.
|
||||
|
||||
Purchases use the normal `gachaService/gachaGetEggs` payload, zero vouchers,
|
||||
unlocked-city checks, a target inventory, batch size, reserved coin balance and
|
||||
restart-persistent per-role daily spending records. The real response's city-ID
|
||||
array form is supported alongside boolean maps. Feeding uses the smaller of
|
||||
the configured target and the current breakthrough cap (`potentialLevel * 10`);
|
||||
unknown caps stop feeding. Yield rows have star filters, and quest rows show
|
||||
coin and premium-currency rewards. See `RANCH_HELPER.md` and the helper README.
|
||||
|
||||
88 tests pass, including an encrypted-HTTP ten-draw -> returned bonus eggs ->
|
||||
hatch -> maturity -> dispatch -> refreshed-balance cycle, timeout accounting,
|
||||
per-species priority/reorder rules, multiple capped feeding recipients,
|
||||
confirmed manual inventory actions and price-checked slot/pasture expansion.
|
||||
The retained real response's empty-slot sentinel is -1; this previously blocked
|
||||
hatching, and is now treated as empty along with zero. Offline replay now plans
|
||||
three non-VIP hatches. Expansion prices derive from actual facility openType
|
||||
counts, matching HistoryVo, and stale quotes require a new confirmation.
|
||||
|
||||
The compact login tab hides protocol fields and no longer opens the debug dialog
|
||||
automatically. Monster rows show breakthrough, reference stats, affection and
|
||||
gift preferences. Equipment, entanglement and global bonuses are excluded from
|
||||
the labeled reference stats. Right-click management supports lock/unlock,
|
||||
confirmed dispatch and feeding. Slot and pasture pages support confirmed normal
|
||||
coin/premium expansion; VIP status is separate.
|
||||
The bottom log is resizable via a vertical splitter and can be hidden without
|
||||
stopping capture; size and visibility restore with account/role settings.
|
||||
Growth handling follows both phase transitions and applies the settlement
|
||||
response's modes/qualities before inventory planning. Pending values are no
|
||||
longer labeled C/C/C/C, and stale role queries cannot overwrite unsettled cached
|
||||
growth. Explicit sync remains separate from dispatch/feeding, and exact
|
||||
protection reasons are visible. Capacity planning also handles roomId=null for
|
||||
incubator monsters; replay of the retained mature response now yields the two
|
||||
protected collections and two dispatches expected by the user's saved rules.
|
||||
The native multi-account UI was rendered with synthetic data. No live account
|
||||
inventory operations or device actions were performed during this update.
|
||||
@@ -0,0 +1,262 @@
|
||||
body
|
||||
maxstack 3
|
||||
localcount 6
|
||||
initscopedepth 0
|
||||
maxscopedepth 1
|
||||
|
||||
code
|
||||
getlocal0
|
||||
pushscope
|
||||
debugfile "D:\\SynchroSpace\\SynologyDrive\\NetSynchroDisk\\yunProject\\develop\\MYRProject\\src1.01;net\\pixvi\\myr\\center;TeamCenter.as"
|
||||
debug 1, "choseTeamName", 0, 0
|
||||
debug 1, "battleTeamVo", 1, 0
|
||||
debug 1, "teamVo", 2, 0
|
||||
debug 1, "i", 3, 0
|
||||
debug 1, "m", 4, 0
|
||||
pushbyte 0
|
||||
setlocal 4
|
||||
pushnull
|
||||
setlocal 5
|
||||
getlocal1
|
||||
debugline 185
|
||||
pushstring ""
|
||||
equals
|
||||
iffalse ofs0041
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.center"),"Master")
|
||||
debugline 186
|
||||
getproperty QName(PackageNamespace(""),"teams")
|
||||
pushbyte 0
|
||||
getproperty MultinameL([PrivateNamespace("net.pixvi.myr.center:TeamCenter"),ProtectedNamespace("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.pfw.utils.core:Singleton"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.center"),PackageInternalNs("net.pixvi.myr.center"),PrivateNamespace("FilePrivateNS:TeamCenter"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.element.team"),"TeamVo")
|
||||
astypelate
|
||||
getproperty QName(PackageNamespace(""),"teamName")
|
||||
coerce_s
|
||||
setlocal1
|
||||
ofs0041:
|
||||
findpropstrict QName(PackageNamespace(""),"getTeamByTeamName")
|
||||
getlocal1
|
||||
debugline 188
|
||||
callproperty QName(PackageNamespace(""),"getTeamByTeamName"), 1
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.element.team"),"TeamVo")
|
||||
setlocal3
|
||||
findpropstrict QName(PackageNamespace("net.pixvi.myr.element.battle"),"BattleTeamVo")
|
||||
debugline 190
|
||||
constructprop QName(PackageNamespace("net.pixvi.myr.element.battle"),"BattleTeamVo"), 0
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.element.battle"),"BattleTeamVo")
|
||||
setlocal2
|
||||
getlocal2
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.center"),"Master")
|
||||
debugline 191
|
||||
getproperty QName(PackageNamespace(""),"ap")
|
||||
setproperty QName(PackageNamespace(""),"ap")
|
||||
getlocal2
|
||||
getlocal2
|
||||
debugline 192
|
||||
getproperty QName(PackageNamespace(""),"ap")
|
||||
setproperty QName(PackageNamespace(""),"apMax")
|
||||
getlocal2
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.center"),"TeamCenter")
|
||||
debugline 193
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getproperty QName(PackageNamespace(""),"fightMonsterNum")
|
||||
setproperty QName(PackageNamespace(""),"numMax")
|
||||
getlocal2
|
||||
debugline 194
|
||||
pushbyte 1
|
||||
setproperty QName(PackageNamespace(""),"team")
|
||||
getlocal2
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.center"),"Master")
|
||||
debugline 195
|
||||
getproperty QName(PackageNamespace(""),"name")
|
||||
setproperty QName(PackageNamespace(""),"name")
|
||||
debugline 197
|
||||
pushbyte 0
|
||||
convert_i
|
||||
setlocal 4
|
||||
debugline 197
|
||||
jump ofs010c
|
||||
ofs0099:
|
||||
label
|
||||
getlocal3
|
||||
debugline 199
|
||||
getproperty QName(PackageNamespace(""),"monsters")
|
||||
getlocal 4
|
||||
getproperty MultinameL([PrivateNamespace("net.pixvi.myr.center:TeamCenter"),ProtectedNamespace("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.pfw.utils.core:Singleton"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.center"),PackageInternalNs("net.pixvi.myr.center"),PrivateNamespace("FilePrivateNS:TeamCenter"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
pushbyte 0
|
||||
lessequals
|
||||
iffalse ofs00af
|
||||
jump ofs0107
|
||||
ofs00af:
|
||||
getlex QName(PackageNamespace("net.pixvi.myr.center"),"MonsterCenter")
|
||||
debugline 200
|
||||
callproperty QName(PackageNamespace(""),"getIns"), 0
|
||||
getlocal3
|
||||
getproperty QName(PackageNamespace(""),"monsters")
|
||||
getlocal 4
|
||||
getproperty MultinameL([PrivateNamespace("net.pixvi.myr.center:TeamCenter"),ProtectedNamespace("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.pfw.utils.core:Singleton"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.center"),PackageInternalNs("net.pixvi.myr.center"),PrivateNamespace("FilePrivateNS:TeamCenter"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
callproperty QName(PackageNamespace(""),"getBattleMonVoByMid"), 1
|
||||
coerce QName(PackageNamespace("net.pixvi.myr.element.battle"),"BattleMonVo")
|
||||
setlocal 5
|
||||
getlocal 5
|
||||
debugline 201
|
||||
pushnull
|
||||
equals
|
||||
iffalse ofs00d4
|
||||
jump ofs0107
|
||||
ofs00d4:
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"atk")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"atk")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"def")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"def")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"dex")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"dex")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"hp")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"hp")
|
||||
setproperty QName(PackageNamespace(""),"hpMax")
|
||||
pop
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"crit")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"crit")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"selfCure")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"selfCure")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"atkVim")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"atkVim")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"atkStun")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"atkStun")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"defStun")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"defStun")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"atkPoi")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"atkPoi")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"atkPoiDmg")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"atkPoiDmg")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"skillCooldown")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_d
|
||||
setproperty QName(PackageNamespace(""),"skillCooldown")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"sunFire")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"sunFire")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"moonHeal")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"moonHeal")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"deadBoom")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"deadBoom")
|
||||
getlocal 5
|
||||
getlocal 5
|
||||
getproperty QName(PackageNamespace(""),"thorns")
|
||||
pushbyte 2
|
||||
multiply
|
||||
convert_i
|
||||
setproperty QName(PackageNamespace(""),"thorns")
|
||||
getlocal 5
|
||||
debugline 202
|
||||
pushbyte 1
|
||||
setproperty QName(PackageNamespace(""),"team")
|
||||
getlocal 5
|
||||
debugline 203
|
||||
pushstring "master"
|
||||
setproperty QName(PackageNamespace(""),"from")
|
||||
getlocal 5
|
||||
debugline 206
|
||||
pushtrue
|
||||
setproperty QName(PackageNamespace(""),"apRecovery")
|
||||
getlocal2
|
||||
debugline 208
|
||||
getproperty QName(PackageNamespace(""),"mons")
|
||||
getlocal 5
|
||||
callproperty QName(Namespace("http://adobe.com/AS3/2006/builtin"),"push"), 1
|
||||
pop
|
||||
getlocal 5
|
||||
getlex QName(PackageNamespace(""),"teamPos2battleTeamPos")
|
||||
getlocal 4
|
||||
debugline 209
|
||||
getproperty MultinameL([PrivateNamespace("net.pixvi.myr.center:TeamCenter"),ProtectedNamespace("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.myr.center:TeamCenter"),StaticProtectedNs("net.pixvi.pfw.utils.core:Singleton"),StaticProtectedNs("Object"),PackageNamespace("net.pixvi.myr.center"),PackageInternalNs("net.pixvi.myr.center"),PrivateNamespace("FilePrivateNS:TeamCenter"),PackageNamespace(""),Namespace("http://adobe.com/AS3/2006/builtin")])
|
||||
setproperty QName(PackageNamespace(""),"teamPos")
|
||||
ofs0107:
|
||||
inclocal_i 4
|
||||
debugline 197
|
||||
ofs010c:
|
||||
getlocal 4
|
||||
getlocal3
|
||||
getproperty QName(PackageNamespace(""),"monsters")
|
||||
getproperty QName(PackageNamespace(""),"length")
|
||||
iflt ofs0099
|
||||
getlocal2
|
||||
debugline 212
|
||||
returnvalue
|
||||
end ; code
|
||||
end ; body
|
||||
@@ -0,0 +1,471 @@
|
||||
package
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
import flash.errors.IOError;
|
||||
import flash.events.ErrorEvent;
|
||||
import flash.events.Event;
|
||||
import flash.filesystem.File;
|
||||
import flash.ui.Multitouch;
|
||||
import flash.utils.getTimer;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.SysSetting;
|
||||
import net.pixvi.common.center.LoaderCenter;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.center.StartUpCenter;
|
||||
import net.pixvi.common.driver.ActivityDriver;
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.driver.TipDriver;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.common.net.ConfigLoader;
|
||||
import net.pixvi.common.net.resource.ResourceLoader;
|
||||
import net.pixvi.common.system.AppLayer;
|
||||
import net.pixvi.common.system.language.LangCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Gesturer;
|
||||
import net.pixvi.common.utils.LogoShow;
|
||||
import net.pixvi.common.utils.PiFixVo;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.utils.global;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.GamePool;
|
||||
import net.pixvi.myr.center.AccountCenter;
|
||||
import net.pixvi.myr.center.DisplayCenter;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.element.user.ServerVo;
|
||||
import net.pixvi.myr.net.NetCenter;
|
||||
import net.pixvi.myr.panel.login.LoginBg;
|
||||
import net.pixvi.myr.panel.login.PressStartPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrcryptor.MYRCryptor;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.myrloader.center.MyrUpdateCenter;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.utils.Browser;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGWaitingPanel;
|
||||
import net.pixvi.psg.utils.Blacker;
|
||||
|
||||
public class MYRStarter
|
||||
{
|
||||
|
||||
public static var binxueInitComplete:Boolean = false;
|
||||
|
||||
private var gesture:Gesturer;
|
||||
|
||||
private var logo:LogoShow;
|
||||
|
||||
private var rl:ResourceLoader;
|
||||
|
||||
private var prevBackTime:int = 0;
|
||||
|
||||
public function MYRStarter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function binxueInitCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
binxueInitComplete = true;
|
||||
}
|
||||
|
||||
public static function getIns() : MYRStarter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(MYRStarter) as MYRStarter;
|
||||
}
|
||||
|
||||
public function MYRStart(mainStage:Sprite) : void
|
||||
{
|
||||
var serverdata:Object = null;
|
||||
var serverReplaceData:Object = null;
|
||||
var newstVersion:Number = NaN;
|
||||
SysSetting.alphaPopPanelTime = 0;
|
||||
SysSetting.popMaskAlpha = 0;
|
||||
SysSetting.buttonUseTouchEvent = false;
|
||||
SysSetting.screenDelay = 1000;
|
||||
Saver.autoMode = 2;
|
||||
Alert.alertScreenMsgTime = 1200;
|
||||
Alert.showMsgAutoScaleCharNum = 23;
|
||||
Alert.globalize = net.pixvi.common.system.language.lang;
|
||||
NetImg.globalImgSrcHack = MyrUpdateCenter.getUpdateSrc;
|
||||
if((SoundCenter as Object).hasOwnProperty("globalSoundSrcHack"))
|
||||
{
|
||||
SoundCenter.globalSoundSrcHack = MyrUpdateCenter.getUpdateSrc;
|
||||
}
|
||||
RM.globalSrcHack = MyrUpdateCenter.getUpdateSrc;
|
||||
RM.swfSrcToBytesFunction = MyrUpdateCenter.swfSrcToBytes;
|
||||
if(MyrCenter.lang == "JP")
|
||||
{
|
||||
MyrCalendar.GLOBAL_TIMEOFFSET = MyrCalendar.TIMEOFFSET_JP;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrCalendar.GLOBAL_TIMEOFFSET = MyrCalendar.TIMEOFFSET_CN;
|
||||
}
|
||||
if(GameMath.ModeCrypto)
|
||||
{
|
||||
NetImg.globalImgCryptoGetBytes = MYRCryptor.getHashSrcBytes;
|
||||
NetImg.globalImgCryptoMode = true;
|
||||
PiStringLoader.globalCryptoModeSrcHash = MYRCryptor.getHashSrc;
|
||||
PiStringLoader.globalJsonCryptoModeFunction = MYRCryptor.jsonDecodeHandler;
|
||||
PiStringLoader.globalCryptoMode = true;
|
||||
}
|
||||
if(MobiTools.isMobi())
|
||||
{
|
||||
Multitouch.inputMode = "touchPoint";
|
||||
SysSetting.buttonUseTouchEvent = true;
|
||||
}
|
||||
mainStage.addChild(StartUpCenter.startUp(mainStage.stage,true));
|
||||
SecondDriver.getInstance().startup();
|
||||
ClockDriver.getInstance().startup();
|
||||
TipDriver.getInstance().startup(9);
|
||||
StageDriver.autoScaleMode();
|
||||
PopCenter.getIns().resizeMode = false;
|
||||
var fsFix1:PiFixVo = new PiFixVo();
|
||||
fsFix1.id = "fs1";
|
||||
fsFix1.maxHWScale = 1.775;
|
||||
var fsFix2:PiFixVo = new PiFixVo();
|
||||
fsFix2.id = "fs2";
|
||||
fsFix2.maxHWScale = 1.9125;
|
||||
StageLocator.autoFull(720,1136,[fsFix1,fsFix2]);
|
||||
StageDriver.stage.quality = "medium";
|
||||
ConfigLoader.getInstance().loadConfig(SysSetting.configFileSrc,onConfigLoaded,null,GameMath.ModeCrypto,MyrUpdateCenter.getIns().getConfigSrcHackLib());
|
||||
if(MyrUpdateCenter.getIns().versionListFile != null && MyrUpdateCenter.getIns().versionListFile.versionServer != null)
|
||||
{
|
||||
serverdata = MyrUpdateCenter.getIns().versionListFile.versionServer;
|
||||
if(serverdata[MyrCenter.channel] == null)
|
||||
{
|
||||
serverReplaceData = serverdata.defaultChannel;
|
||||
}
|
||||
else
|
||||
{
|
||||
serverReplaceData = serverdata[MyrCenter.channel];
|
||||
}
|
||||
newstVersion = MyrUpdateCenter.getIns().lastVersion;
|
||||
if(MyrUpdateCenter.getIns().buildVersion > newstVersion)
|
||||
{
|
||||
newstVersion = MyrUpdateCenter.getIns().buildVersion;
|
||||
}
|
||||
trace("lastVersion,channel",newstVersion,MyrCenter.channel);
|
||||
if(newstVersion >= serverReplaceData.min && newstVersion <= serverReplaceData.max)
|
||||
{
|
||||
MyrCenter.serverChannel = serverReplaceData.versionChannel;
|
||||
}
|
||||
trace("channel",MyrCenter.serverChannel);
|
||||
}
|
||||
}
|
||||
|
||||
private function onConfigLoaded() : void
|
||||
{
|
||||
LoaderCenter.getInstance().loadWhenStart(sourceComplete,null,null,null,false);
|
||||
}
|
||||
|
||||
private function sourceComplete() : void
|
||||
{
|
||||
var langdata:Object = null;
|
||||
trace("初始资源加载完毕");
|
||||
Saver.setGlobalSite(global.setting.gameSaveName);
|
||||
if(MyrCenter.hasLang())
|
||||
{
|
||||
trace("load lang...");
|
||||
langdata = RM.TXT.getJson("lang");
|
||||
LangCenter.getInstance().loadJson(langdata);
|
||||
}
|
||||
MobiTools.getIns().startup();
|
||||
MobiTools.getIns().onBackFun = backBtnHandler;
|
||||
DisplayCenter.getIns().startUp();
|
||||
initSdk();
|
||||
}
|
||||
|
||||
private function initSdk() : void
|
||||
{
|
||||
trace("startInitSDK",MyrCenter.channel,MyrCenter.platform,MyrCenter.lang);
|
||||
if(MobiTools.isMobi())
|
||||
{
|
||||
if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
MyrAne.initBlbl("777","04821523c52241d1b6fe52152022b54e","1383","1000",false,autoShowLogo);
|
||||
}
|
||||
else if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
if(MyrAne.meizu2Bingxue)
|
||||
{
|
||||
autoShowLogo();
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.initMeizu("520","191fc001357fcdbacb37f5e92887b983","8a687a9798c0a3b77a3e247a620c65d2",autoShowLogo);
|
||||
}
|
||||
}
|
||||
else if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
if(MyrCenter.platform == "IOS")
|
||||
{
|
||||
MyrAne.iosInitXD("163313","0e9676b93c53729a48890a87165ba0e3","ios_jp_shepherd");
|
||||
trace("myrXDAneSdkInit");
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.initXD("163314","0e9676b93c53729a48890a87165ba0e3","android_jp_shepherd","jp");
|
||||
}
|
||||
autoShowLogo();
|
||||
}
|
||||
else if(MyrCenter.channel == "CPG")
|
||||
{
|
||||
MyrAne.initCPG("2VQiS2uSWpK3T5l0d8c2",false,empty);
|
||||
autoShowLogo();
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.initDyd(76813411,"WicgaI9bN0FoQbK5","牧羊人之心",autoShowLogo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
autoShowLogo();
|
||||
}
|
||||
}
|
||||
|
||||
public function empty(e:Object = null) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function autoShowLogo() : void
|
||||
{
|
||||
trace("startShowLogo");
|
||||
var quickLogin:Object = Saver.getAuto(MyrCenter.channel + "quickLogin");
|
||||
var day:int = new Date().date;
|
||||
if(quickLogin != null && int(quickLogin) == day)
|
||||
{
|
||||
showLogo(null,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Saver.saveAuto(MyrCenter.channel + "quickLogin",day);
|
||||
showLogo();
|
||||
}
|
||||
}
|
||||
|
||||
private function showLogo(e:Event = null, quick:Boolean = false) : void
|
||||
{
|
||||
if(MyrCenter.lang == "JP")
|
||||
{
|
||||
logo = new LogoShow(showStartMenuBG,"ui.LogosXd",quick);
|
||||
}
|
||||
else if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
logo = new LogoShow(showStartMenuBG,"ui.LogosBlbl",quick);
|
||||
}
|
||||
else if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
logo = new LogoShow(showStartMenuBG,"ui.LogosMeizu",quick);
|
||||
}
|
||||
else
|
||||
{
|
||||
logo = new LogoShow(showStartMenuBG,"ui.Logos",quick);
|
||||
}
|
||||
gesture = new Gesturer(logo);
|
||||
gesture.longPressTime = 5000;
|
||||
gesture.start();
|
||||
gesture.addEventListener(Gesturer.LONG_PRESS,longPressHandler);
|
||||
AppLayer.app.LAYER_BG.addChild(logo);
|
||||
logo.start();
|
||||
}
|
||||
|
||||
public function longPressHandler(e:Event = null) : void
|
||||
{
|
||||
logo.complete = null;
|
||||
Alert.yesno(net.pixvi.common.system.language.lang("更新修复"),net.pixvi.common.system.language.lang("修复因更新带来的文件损坏等问题,点击确定开始修复。"),startCleanHandler,MobiTools.getIns().exit);
|
||||
}
|
||||
|
||||
private function startCleanHandler() : void
|
||||
{
|
||||
try
|
||||
{
|
||||
File.applicationStorageDirectory.resolvePath("version.json").deleteFile();
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
if(e is IOError)
|
||||
{
|
||||
Alert.yes("Remove denied","Remove denied,unknow error:" + e.toString(),MobiTools.getIns().exit);
|
||||
return;
|
||||
}
|
||||
Alert.yes("Remove denied","Security error:" + e.toString(),MobiTools.getIns().exit);
|
||||
return;
|
||||
}
|
||||
Alert.yes(net.pixvi.common.system.language.lang("提示"),net.pixvi.common.system.language.lang("已重置版本,请重新运行游戏。"),MobiTools.getIns().exit);
|
||||
}
|
||||
|
||||
private function showStartMenuBG() : void
|
||||
{
|
||||
logo = null;
|
||||
Game.getIns().initSetting();
|
||||
var hw:Number = StageLocator.MainFixVo.fixHeight / StageLocator.MainFixVo.fixWidth;
|
||||
if(MyrCenter.platform == "ios" && hw > 2)
|
||||
{
|
||||
Game.getIns().setting.liuhaiMode = true;
|
||||
Game.getIns().saveSetting();
|
||||
}
|
||||
SoundCenter.getInstance().bgmPlay(GameSound.bgm_theme);
|
||||
PopCenter.POP(LoginBg.getIns());
|
||||
LoginBg.getIns().trace("1%");
|
||||
Caller.delayCall(startLoadMainUI,330,1);
|
||||
}
|
||||
|
||||
private function startLoadMainUI() : void
|
||||
{
|
||||
PSGWaitingPanel.getIns().setPanel(net.pixvi.common.system.language.lang("数据读取中..."));
|
||||
PopCenter.POP(PSGWaitingPanel.getIns());
|
||||
rl = LoaderCenter.getInstance().loadTeam("secondload",onMainResourceLoadComplete,onMainResourceProcess,onSecondLoadErrorHandler);
|
||||
}
|
||||
|
||||
private function onMainResourceProcess(e:Event = null) : void
|
||||
{
|
||||
if(rl == null)
|
||||
{
|
||||
trace("rl=null");
|
||||
return;
|
||||
}
|
||||
if(rl.curResource != null)
|
||||
{
|
||||
trace(rl.filesLoaded.toString() + rl.curResource.id);
|
||||
LoginBg.getIns().trace(rl.filesLoaded.toString() + rl.curResource.id.substr(0,3));
|
||||
}
|
||||
else
|
||||
{
|
||||
LoginBg.getIns().trace(rl.filesLoaded.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private function onSecondLoadErrorHandler(e:ErrorEvent) : void
|
||||
{
|
||||
Alert.yes("Load error",Paster.font(e.text,null,16));
|
||||
}
|
||||
|
||||
private function onMainResourceLoadComplete() : void
|
||||
{
|
||||
LoginBg.getIns().trace("10%");
|
||||
Table.startUp();
|
||||
NetCenter.autoSetServer();
|
||||
PSGWaitingPanel.getIns().setPanel("Loading...");
|
||||
LoginBg.getIns().trace("40%");
|
||||
prepareCenter();
|
||||
PSGWaitingPanel.getIns().setPanel("Loading....");
|
||||
LoginBg.getIns().trace("50%");
|
||||
showLoginPanel();
|
||||
}
|
||||
|
||||
public function updatefileProcess(fileloaded:int, filesTotal:int) : void
|
||||
{
|
||||
PSGWaitingPanel.getIns().setPanel("update files...(" + fileloaded + "/" + filesTotal + ")");
|
||||
}
|
||||
|
||||
private function prepareCenter() : void
|
||||
{
|
||||
Blacker.getIns().container = AppLayer.app.LAYER_AD;
|
||||
var transImg:NetBitImg = new NetBitImg("data/gc.jpg",0,0,true,true,0);
|
||||
Blacker.getIns().changeView(transImg);
|
||||
LoginBg.getIns().trace("60%");
|
||||
StageLocator.setfullWithNoFix(transImg);
|
||||
AppLayer.app.LAYER_AD.mouseChildren = AppLayer.app.LAYER_AD.mouseEnabled = true;
|
||||
GAoNano.getIns().startUp();
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
GAoNano.getIns().traceMode = true;
|
||||
}
|
||||
LoginBg.getIns().trace("70%");
|
||||
ActivityDriver.getIns().startup();
|
||||
GameSound.startup();
|
||||
GamePool.startUp();
|
||||
Alert.PSGMode = true;
|
||||
StageLocator.setfullWithNoFix(GAoNano.getIns().stage,1,"center","center");
|
||||
LoginBg.getIns().trace("80%");
|
||||
}
|
||||
|
||||
public function onForceUpdateDyd(e:Event = null) : void
|
||||
{
|
||||
Browser.gotoPage("https://myrzx.cdn.comiai.com/packages/diyidan-1.6.2-myrzx.apk");
|
||||
}
|
||||
|
||||
private function showLoginPanel() : void
|
||||
{
|
||||
if(MyrCenter.channel == "DYD" && MyrCenter.platform == "ANDROID" && (MyrUpdateCenter.getIns().buildVersion < 1.5 && MyrUpdateCenter.getIns().lastVersion < 1.41))
|
||||
{
|
||||
Alert.yes("提示","客户端版本过低,请更新客户端后进行游戏。",onForceUpdateDyd);
|
||||
return;
|
||||
}
|
||||
LoginBg.getIns().trace("");
|
||||
PSGWaitingPanel.getIns().showOut();
|
||||
PopCenter.POP(PressStartPanel.getIns());
|
||||
}
|
||||
|
||||
private function backBtnHandler(e:Event = null) : void
|
||||
{
|
||||
var curServer:ServerVo = null;
|
||||
if(PopCenter.getIns().panelNum > 1 && !(PopCenter.getIns().topPanel is PressStartPanel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(MobiTools.isMobi() && MyrCenter.channel == "MEIZU" && Boolean(MyrAne.meizu2Bingxue))
|
||||
{
|
||||
MyrAne.bingxueExitGame(onExitGameHandler);
|
||||
return;
|
||||
}
|
||||
if(getTimer() - prevBackTime > 2000)
|
||||
{
|
||||
prevBackTime = getTimer();
|
||||
Alert.showMsg(Paster.font(net.pixvi.common.system.language.lang("再次按下[返回键]退出游戏。"),"#ff0000"));
|
||||
}
|
||||
else if(MyrCenter.channel == "MEIZU" && MobiTools.isMobi())
|
||||
{
|
||||
if(MyrAne.meizu2Bingxue)
|
||||
{
|
||||
if(MobiTools.isMobi() && MyrCenter.channel == "MEIZU" && Boolean(MyrAne.meizu2Bingxue))
|
||||
{
|
||||
curServer = AccountCenter.getIns().curServer;
|
||||
if(curServer != null && Master != null)
|
||||
{
|
||||
MyrAne.bingxueSetRoleData(5,curServer.serverId,curServer.serverName,curServer.masterId.toString(),curServer.masterName,Master.level.toString(),Master.money,"驯养师","","牧羊人之心");
|
||||
}
|
||||
}
|
||||
MyrAne.bingxueExitGame(onExitGameHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.meizuExitGame(onExitGameHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
}
|
||||
|
||||
public function onExitGameHandler(re:String = "-1") : void
|
||||
{
|
||||
if(MobiTools.isMobi() && MyrCenter.channel == "MEIZU" && Boolean(MyrAne.meizu2Bingxue))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(re == "1")
|
||||
{
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.hurlant.crypto
|
||||
{
|
||||
import com.hurlant.crypto.symmetric.AESKey;
|
||||
import com.hurlant.crypto.symmetric.CBCMode;
|
||||
import com.hurlant.crypto.symmetric.DESKey;
|
||||
import com.hurlant.crypto.symmetric.ECBMode;
|
||||
import com.hurlant.crypto.symmetric.IPad;
|
||||
import com.hurlant.crypto.symmetric.TripleDESKey;
|
||||
import com.hurlant.util.Hex;
|
||||
import flash.utils.ByteArray;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.crypto.Base64;
|
||||
|
||||
public class Crypter
|
||||
{
|
||||
|
||||
private static const cipher:Object = {};
|
||||
|
||||
public function Crypter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
private static function strDecode(byteArr:ByteArray, mode:String) : String
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case "hex":
|
||||
return Hex.fromArray(byteArr);
|
||||
case "base64":
|
||||
return Base64.Encode(byteArr);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function strEncode(str:String, mode:String) : ByteArray
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case "hex":
|
||||
return Hex.toArray(str);
|
||||
case "base64":
|
||||
return Base64.Decode(str);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function aesEncode(str:String, key:String, strMode:String = "base64", keyMode:String = "base64") : String
|
||||
{
|
||||
var strByteArray:ByteArray = Paster.string2ByteArray(str);
|
||||
aesBytesEncode(strByteArray,key,keyMode);
|
||||
return strDecode(strByteArray,strMode);
|
||||
}
|
||||
|
||||
public static function aesBytesEncode(bytes:ByteArray, key:String, keyMode:String = "base64") : void
|
||||
{
|
||||
var keyb:ByteArray = null;
|
||||
var ecb:ECBMode = null;
|
||||
var aes:AESKey = null;
|
||||
var pad:IPad = null;
|
||||
if(cipher[key] != null)
|
||||
{
|
||||
ecb = cipher[key];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(keyMode == "base64")
|
||||
{
|
||||
keyb = Base64.Decode(key);
|
||||
}
|
||||
else if(keyMode == "hex")
|
||||
{
|
||||
keyb = Hex.toArray(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyb = Paster.string2ByteArray(key);
|
||||
}
|
||||
aes = new AESKey(keyb);
|
||||
pad = Crypto.getPad("pkcs5");
|
||||
ecb = new ECBMode(aes,pad);
|
||||
cipher[key] = ecb;
|
||||
}
|
||||
ecb.encrypt(bytes);
|
||||
}
|
||||
|
||||
public static function aesDecode(aescode:String, key:String, strMode:String = "base64", keyMode:String = "base64") : String
|
||||
{
|
||||
var databyte:ByteArray = strEncode(aescode,strMode);
|
||||
aesBytesDecode(databyte,key,keyMode);
|
||||
return Paster.byteArray2String(databyte);
|
||||
}
|
||||
|
||||
public static function aesBytesDecode(bytes:ByteArray, key:String, keyMode:String = "base64") : void
|
||||
{
|
||||
var keyb:ByteArray = null;
|
||||
var ecb:ECBMode = null;
|
||||
var aes:AESKey = null;
|
||||
var pad:IPad = null;
|
||||
if(cipher[key] != null)
|
||||
{
|
||||
ecb = cipher[key];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(keyMode == "base64")
|
||||
{
|
||||
keyb = Base64.Decode(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyb = Paster.string2ByteArray(key);
|
||||
}
|
||||
aes = new AESKey(keyb);
|
||||
pad = Crypto.getPad("pkcs5");
|
||||
ecb = new ECBMode(aes,pad);
|
||||
cipher[key] = ecb;
|
||||
}
|
||||
ecb.decrypt(bytes);
|
||||
}
|
||||
|
||||
public static function des3Encode(str:String, key:String, iv:String, strMode:String = "base64") : String
|
||||
{
|
||||
var keyb:ByteArray = Paster.string2ByteArray(key);
|
||||
var ivb:ByteArray = Paster.string2ByteArray(iv);
|
||||
var des:TripleDESKey = new TripleDESKey(keyb);
|
||||
var cbc:CBCMode = new CBCMode(des);
|
||||
cbc.IV = ivb;
|
||||
var strByteArray:ByteArray = Paster.string2ByteArray(str);
|
||||
cbc.encrypt(strByteArray);
|
||||
return strDecode(strByteArray,strMode);
|
||||
}
|
||||
|
||||
public static function des3Decode(des3code:String, key:String, iv:String, strMode:String = "base64") : String
|
||||
{
|
||||
var keyb:ByteArray = Paster.string2ByteArray(key);
|
||||
var ivb:ByteArray = Paster.string2ByteArray(iv);
|
||||
var des:TripleDESKey = new TripleDESKey(keyb);
|
||||
var cbc:CBCMode = new CBCMode(des);
|
||||
cbc.IV = ivb;
|
||||
var databyte:ByteArray = strEncode(des3code,strMode);
|
||||
cbc.decrypt(databyte);
|
||||
return Paster.byteArray2String(databyte);
|
||||
}
|
||||
|
||||
public static function desEncode(str:String, key:String, iv:String, strMode:String = "base64") : String
|
||||
{
|
||||
var keyb:ByteArray = Paster.string2ByteArray(key);
|
||||
var ivb:ByteArray = Paster.string2ByteArray(iv);
|
||||
var des:DESKey = new DESKey(keyb);
|
||||
var cbc:CBCMode = new CBCMode(des);
|
||||
cbc.IV = ivb;
|
||||
var strByteArray:ByteArray = Paster.string2ByteArray(str);
|
||||
cbc.encrypt(strByteArray);
|
||||
return strDecode(strByteArray,strMode);
|
||||
}
|
||||
|
||||
public static function desDecode(descode:String, key:String, iv:String, strMode:String = "base64") : String
|
||||
{
|
||||
var keyb:ByteArray = Paster.string2ByteArray(key);
|
||||
var ivb:ByteArray = Paster.string2ByteArray(iv);
|
||||
var des:DESKey = new DESKey(keyb);
|
||||
var cbc:CBCMode = new CBCMode(des);
|
||||
cbc.IV = ivb;
|
||||
var databyte:ByteArray = Base64.Decode(descode);
|
||||
cbc.decrypt(databyte);
|
||||
return strDecode(databyte,strMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package net.pixvi.common.net
|
||||
{
|
||||
import net.pixvi.common.manager.resource.ConfigManager;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class ConfigLoader extends Singleton
|
||||
{
|
||||
|
||||
private var _onLoaded:Function;
|
||||
|
||||
private var loader:PiStringLoader;
|
||||
|
||||
private var srcHack:Object = {};
|
||||
|
||||
public function ConfigLoader()
|
||||
{
|
||||
super();
|
||||
loader = new PiStringLoader();
|
||||
}
|
||||
|
||||
public static function getInstance() : ConfigLoader
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ConfigLoader) as ConfigLoader;
|
||||
}
|
||||
|
||||
public function loadConfig(src:String, onloaded:Function = null, onerror:Function = null, crypto:Boolean = false, srcHack:Object = null) : void
|
||||
{
|
||||
this._onLoaded = onloaded;
|
||||
if(srcHack != null)
|
||||
{
|
||||
this.srcHack = srcHack;
|
||||
}
|
||||
loader.cryptoMode = crypto;
|
||||
loader.load(src,completeHandler,null,onerror);
|
||||
}
|
||||
|
||||
private function completeHandler() : void
|
||||
{
|
||||
ConfigManager.getInstance().setup(new XML(loader.getData()),srcHack);
|
||||
this._onLoaded.call();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package net.pixvi.common.net.remote
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLRequestHeader;
|
||||
import flash.utils.Timer;
|
||||
|
||||
public class HttpRemote
|
||||
{
|
||||
|
||||
public static const TRADITIONAL_DATAFORMAT:String = "traditional";
|
||||
|
||||
public static const JSON_DATAFORMAT:String = "jsonDataFormat";
|
||||
|
||||
public var _callBackFun:Function;
|
||||
|
||||
private var _errorFun:Function;
|
||||
|
||||
private var _loader:URLLoader;
|
||||
|
||||
private var _request:URLRequest;
|
||||
|
||||
private var overTimer:Timer;
|
||||
|
||||
public var url:String;
|
||||
|
||||
private var _data:Object;
|
||||
|
||||
public var retryMode:Boolean = false;
|
||||
|
||||
public var cryptoMode:Boolean = false;
|
||||
|
||||
public var waiting:Boolean = true;
|
||||
|
||||
public var errorBack:Boolean = false;
|
||||
|
||||
public function HttpRemote(url:String, sendData:Object, callBackFun:Function = null, errorFun:Function = null, requestHeaders:Array = null, overTime:int = 1500, dataFormat:String = "text")
|
||||
{
|
||||
var i:int = 0;
|
||||
super();
|
||||
this.url = url;
|
||||
this._callBackFun = callBackFun;
|
||||
this._errorFun = errorFun;
|
||||
var request:URLRequest = new URLRequest(url);
|
||||
_loader = new URLLoader();
|
||||
if(dataFormat == "text")
|
||||
{
|
||||
request.contentType = "text/xml";
|
||||
_loader.dataFormat = "text";
|
||||
}
|
||||
else if(dataFormat == "binary")
|
||||
{
|
||||
request.contentType = "application/octet-stream";
|
||||
_loader.dataFormat = "binary";
|
||||
}
|
||||
else if(dataFormat == "variables")
|
||||
{
|
||||
request.contentType = "application/x-www-form-urlencoded";
|
||||
_loader.dataFormat = "binary";
|
||||
}
|
||||
else if(dataFormat == "traditional")
|
||||
{
|
||||
request.contentType = "application/x-www-form-urlencoded";
|
||||
_loader.dataFormat = "text";
|
||||
}
|
||||
else if(dataFormat == "jsonDataFormat")
|
||||
{
|
||||
request.contentType = "application/json;charset=UTF-8";
|
||||
_loader.dataFormat = "text";
|
||||
}
|
||||
var rhArray:Array = [];
|
||||
if(requestHeaders != null)
|
||||
{
|
||||
for(i = 0; i < requestHeaders.length; )
|
||||
{
|
||||
rhArray.push(new URLRequestHeader(requestHeaders[i][0],requestHeaders[i][1]));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
request.data = sendData;
|
||||
_data = sendData;
|
||||
request.method = "POST";
|
||||
request.requestHeaders = rhArray;
|
||||
_request = request;
|
||||
if(overTime > 0)
|
||||
{
|
||||
overTimer = new Timer(overTime,1);
|
||||
overTimer.addEventListener("timerComplete",timerHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
if(overTimer != null)
|
||||
{
|
||||
overTimer.start();
|
||||
}
|
||||
_loader.addEventListener("complete",completeHandler);
|
||||
_loader.addEventListener("ioError",errorHandler);
|
||||
trace("【loadURL】 " + _request.url);
|
||||
_loader.load(_request);
|
||||
}
|
||||
|
||||
protected function timerHandler(e:TimerEvent) : void
|
||||
{
|
||||
errorHandler(null);
|
||||
}
|
||||
|
||||
private function completeHandler(e:Event) : void
|
||||
{
|
||||
trace("【loadData】 " + e.target.data);
|
||||
this._callBackFun(e.target.data);
|
||||
this._callBackFun = null;
|
||||
this._errorFun = null;
|
||||
if(overTimer != null)
|
||||
{
|
||||
overTimer.stop();
|
||||
overTimer.removeEventListener("timerComplete",timerHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function errorHandler(event:IOErrorEvent) : void
|
||||
{
|
||||
if(overTimer != null)
|
||||
{
|
||||
overTimer.reset();
|
||||
}
|
||||
_loader.removeEventListener("ioError",errorHandler);
|
||||
if(this._errorFun != null)
|
||||
{
|
||||
if(event == null)
|
||||
{
|
||||
event = new IOErrorEvent("ioError");
|
||||
event.text = "[HttpRemote]请求超时(" + int(overTimer.delay / 1000) + "s)!url:" + url;
|
||||
}
|
||||
this._errorFun(event);
|
||||
}
|
||||
if(!retryMode)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
private function clear() : void
|
||||
{
|
||||
_loader.removeEventListener("complete",completeHandler);
|
||||
_loader.removeEventListener("ioError",errorHandler);
|
||||
if(overTimer != null)
|
||||
{
|
||||
overTimer.stop();
|
||||
overTimer.removeEventListener("timerComplete",timerHandler);
|
||||
overTimer = null;
|
||||
}
|
||||
_loader = null;
|
||||
this._callBackFun = null;
|
||||
this._errorFun = null;
|
||||
}
|
||||
|
||||
public function get data() : Object
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.common.net.remote
|
||||
{
|
||||
public class HttpRemoteContentType
|
||||
{
|
||||
|
||||
public static const TEXT_XML:String = "text/xml";
|
||||
|
||||
public static const APPLICATION_OCTET_STREAM:String = "application/octet-stream";
|
||||
|
||||
public static const X_WWW_FORM_URLENCODED:String = "application/x-www-form-urlencoded";
|
||||
|
||||
public static const JSON_CONTENT:String = "application/json;charset=UTF-8";
|
||||
|
||||
public function HttpRemoteContentType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
package net.pixvi.common.net.resource
|
||||
{
|
||||
import flash.events.ErrorEvent;
|
||||
import net.pixvi.common.SysSetting;
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.pfw.net.PiDisplayLoader;
|
||||
import net.pixvi.pfw.net.base.PiLoader;
|
||||
|
||||
public class ResourceLoader extends PiLoader
|
||||
{
|
||||
|
||||
private var _resourceList:Array;
|
||||
|
||||
private var _resource:ResourceVo;
|
||||
|
||||
private var _flag:int = 0;
|
||||
|
||||
private var loader:PiLoader;
|
||||
|
||||
private var _allBytesLoaded:int = 0;
|
||||
|
||||
private var _allBytesTotal:int = 0;
|
||||
|
||||
public function ResourceLoader()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function load(list:*, onComplete:Function = null, onProgress:Function = null, onError:Function = null) : void
|
||||
{
|
||||
var resourceArr:Array = null;
|
||||
if(list is Vector.<ResourceVo>)
|
||||
{
|
||||
resourceArr = [];
|
||||
for each(var rv:ResourceVo in list)
|
||||
{
|
||||
resourceArr.push(rv);
|
||||
}
|
||||
_resourceList = resourceArr;
|
||||
}
|
||||
else
|
||||
{
|
||||
_resourceList = list;
|
||||
}
|
||||
super.load(_resourceList,onComplete,onProgress,onError);
|
||||
}
|
||||
|
||||
public function get filesTotal() : int
|
||||
{
|
||||
return _resourceList.length;
|
||||
}
|
||||
|
||||
public function get filesLoaded() : int
|
||||
{
|
||||
return _flag;
|
||||
}
|
||||
|
||||
override public function doLoad() : void
|
||||
{
|
||||
startCurrentLoader();
|
||||
}
|
||||
|
||||
public function getResource(id:String) : ResourceVo
|
||||
{
|
||||
for each(var r:ResourceVo in _resourceList)
|
||||
{
|
||||
if(r.id == id)
|
||||
{
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function startCurrentLoader() : void
|
||||
{
|
||||
if(_flag < _resourceList.length)
|
||||
{
|
||||
_resource = _resourceList[_flag];
|
||||
trace("[ResourceLoader]" + _resource.src + " " + _flag);
|
||||
if(_resource.loaded)
|
||||
{
|
||||
_allBytesLoaded += _resource.size;
|
||||
_flag++;
|
||||
startCurrentLoader();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_resource.type == null || _resource.type == "")
|
||||
{
|
||||
_resource.setBySrc(_resource.src);
|
||||
}
|
||||
loader = ResourceType.createLoader(_resource.type,_resource.crypto,_resource.binaryMode);
|
||||
loader.load(_resource.src,loaderComplete,loaderProgress,loaderError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
completeHandler();
|
||||
removeHandler();
|
||||
}
|
||||
}
|
||||
|
||||
public function get curResource() : ResourceVo
|
||||
{
|
||||
return _resource;
|
||||
}
|
||||
|
||||
private function loaderComplete() : void
|
||||
{
|
||||
_flag++;
|
||||
_allBytesLoaded += loader.bytesTotal;
|
||||
trace(loader + "【加载完毕】" + loader.src + "[" + loader.bytesTotal + "]");
|
||||
if(loader is PiDisplayLoader)
|
||||
{
|
||||
trace("binaryMode:" + (loader as PiDisplayLoader).binaryMode);
|
||||
}
|
||||
loader.removeHandler();
|
||||
_resource.data = loader.getData();
|
||||
RM.getInstance().add(_resource);
|
||||
loader = null;
|
||||
startCurrentLoader();
|
||||
}
|
||||
|
||||
private function loaderProgress() : void
|
||||
{
|
||||
if(loader.bytesTotal > 0 && _resource.size != loader.bytesLoaded)
|
||||
{
|
||||
_resource.size = loader.bytesTotal;
|
||||
}
|
||||
progressHandler();
|
||||
}
|
||||
|
||||
private function loaderError(e:ErrorEvent) : void
|
||||
{
|
||||
loader.removeHandler();
|
||||
loader.unload();
|
||||
if(_resource.retryCount < SysSetting.maxRetry)
|
||||
{
|
||||
trace("资源" + _resource.src + "加载失败!重试: " + _resource.retryCount + 1);
|
||||
_resource.retryCount++;
|
||||
startCurrentLoader();
|
||||
return;
|
||||
}
|
||||
throw new Error("资源" + _resource.src + "加载失败!");
|
||||
}
|
||||
|
||||
public function get allBytesTotal() : uint
|
||||
{
|
||||
var i:int = 0;
|
||||
_allBytesTotal = 0;
|
||||
var len:int = int(_resourceList.length);
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if(_resourceList[i].size && !_resourceList[i].failed)
|
||||
{
|
||||
_allBytesTotal += _resourceList[i].size;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return _allBytesTotal;
|
||||
}
|
||||
|
||||
public function get allBytesLoaded() : uint
|
||||
{
|
||||
if(loader != null)
|
||||
{
|
||||
return _allBytesLoaded + loader.bytesLoaded;
|
||||
}
|
||||
return _allBytesLoaded;
|
||||
}
|
||||
|
||||
override public function stopLoad() : void
|
||||
{
|
||||
if(loader != null)
|
||||
{
|
||||
loader.stopLoad();
|
||||
}
|
||||
}
|
||||
|
||||
override public function getData() : *
|
||||
{
|
||||
return _resourceList;
|
||||
}
|
||||
|
||||
public function get smartLoadedPercent() : Number
|
||||
{
|
||||
return filesLoaded / filesTotal + bytesLoaded / bytesTotal * (1 / filesTotal);
|
||||
}
|
||||
|
||||
public function get loadedPercent() : Number
|
||||
{
|
||||
return allBytesLoaded / allBytesTotal;
|
||||
}
|
||||
|
||||
override public function get bytesLoaded() : int
|
||||
{
|
||||
if(loader != null)
|
||||
{
|
||||
return loader.bytesLoaded;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
override public function get bytesTotal() : int
|
||||
{
|
||||
if(loader != null)
|
||||
{
|
||||
return loader.bytesTotal;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function removeAllResource() : void
|
||||
{
|
||||
for each(var r:ResourceVo in _resourceList)
|
||||
{
|
||||
RM.getInstance().remove(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package net.pixvi.common.net.resource
|
||||
{
|
||||
import net.pixvi.pfw.display.NetImg;
|
||||
import net.pixvi.pfw.net.PiByteLoader;
|
||||
import net.pixvi.pfw.net.PiDisplayLoader;
|
||||
import net.pixvi.pfw.net.PiSoundLoader;
|
||||
import net.pixvi.pfw.net.PiStringLoader;
|
||||
import net.pixvi.pfw.net.base.PiLoader;
|
||||
|
||||
public class ResourceType
|
||||
{
|
||||
|
||||
public static const SWF:String = "swf";
|
||||
|
||||
public static const XML:String = "xml";
|
||||
|
||||
public static const JPG:String = "jpg";
|
||||
|
||||
public static const PNG:String = "png";
|
||||
|
||||
public static const CSV:String = "csv";
|
||||
|
||||
public static const MP3:String = "mp3";
|
||||
|
||||
public static const BYTE:String = "byte";
|
||||
|
||||
public static const TXT:String = "txt";
|
||||
|
||||
public static const JSON:String = "json";
|
||||
|
||||
public function ResourceType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function createLoader(type:String, crypto:Boolean = false, binaryMode:Boolean = false) : PiLoader
|
||||
{
|
||||
var loader:PiLoader = null;
|
||||
switch(type)
|
||||
{
|
||||
case "jpg":
|
||||
case "png":
|
||||
case "swf":
|
||||
loader = new PiDisplayLoader();
|
||||
if((type == "jpg" || type == "png") && NetImg.globalImgCryptoMode)
|
||||
{
|
||||
(loader as PiDisplayLoader).cryptoMode = true;
|
||||
}
|
||||
if(type == "swf" && binaryMode)
|
||||
{
|
||||
(loader as PiDisplayLoader).binaryMode = true;
|
||||
}
|
||||
break;
|
||||
case "xml":
|
||||
case "csv":
|
||||
case "txt":
|
||||
loader = new PiStringLoader();
|
||||
if(crypto)
|
||||
{
|
||||
(loader as PiStringLoader).cryptoMode = true;
|
||||
}
|
||||
break;
|
||||
case "json":
|
||||
if(crypto && PiStringLoader.globalCryptoMode)
|
||||
{
|
||||
loader = new PiByteLoader();
|
||||
loader["jsonCryptoMode"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
loader = new PiStringLoader();
|
||||
}
|
||||
break;
|
||||
case "mp3":
|
||||
loader = new PiSoundLoader();
|
||||
break;
|
||||
default:
|
||||
case "byte":
|
||||
loader = new PiByteLoader();
|
||||
}
|
||||
return loader;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.common.net.resource
|
||||
{
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
|
||||
public class ResourceVo implements IDispose
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var src:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var size:int;
|
||||
|
||||
public var loadwhenstart:int;
|
||||
|
||||
public var team:String;
|
||||
|
||||
public var param:String;
|
||||
|
||||
public var paramObj:Object;
|
||||
|
||||
public var crypto:Boolean = false;
|
||||
|
||||
public var binaryMode:Boolean = false;
|
||||
|
||||
private var _loaded:Boolean;
|
||||
|
||||
private var _failed:Boolean = false;
|
||||
|
||||
public var retryCount:int = 0;
|
||||
|
||||
private var _data:*;
|
||||
|
||||
public function ResourceVo(src:String = "")
|
||||
{
|
||||
super();
|
||||
_loaded = false;
|
||||
paramObj = {};
|
||||
if(src != "")
|
||||
{
|
||||
setBySrc(src);
|
||||
}
|
||||
}
|
||||
|
||||
public function setBySrc(src:String) : void
|
||||
{
|
||||
this.src = src;
|
||||
var tag:Array = src.split("/");
|
||||
var file:String = tag[tag.length - 1];
|
||||
tag = file.split(".");
|
||||
type = tag[1];
|
||||
id = tag[0];
|
||||
loaded = false;
|
||||
size = -1;
|
||||
}
|
||||
|
||||
public function get loaded() : Boolean
|
||||
{
|
||||
return _loaded;
|
||||
}
|
||||
|
||||
public function get data() : *
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
|
||||
public function set data(value:*) : void
|
||||
{
|
||||
_data = value;
|
||||
if(!loaded)
|
||||
{
|
||||
_loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeData() : void
|
||||
{
|
||||
_data = null;
|
||||
_loaded = false;
|
||||
}
|
||||
|
||||
public function get failed() : Boolean
|
||||
{
|
||||
return _failed;
|
||||
}
|
||||
|
||||
public function set failed(value:Boolean) : void
|
||||
{
|
||||
_failed = value;
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
_loaded = false;
|
||||
_failed = false;
|
||||
_data = null;
|
||||
}
|
||||
|
||||
public function set loaded(value:Boolean) : void
|
||||
{
|
||||
_loaded = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package net.pixvi.myr
|
||||
{
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class CP
|
||||
{
|
||||
|
||||
public static var ZI:uint = 16711866;
|
||||
|
||||
public static var RED:uint = 12333361;
|
||||
|
||||
public static var ZONG:uint = 8606003;
|
||||
|
||||
public static var GOLD:uint = 16777011;
|
||||
|
||||
public static var KE:uint = 16738047;
|
||||
|
||||
public static var MONEY:uint = 16750848;
|
||||
|
||||
public static const qualityUint:Object = {
|
||||
1:16777215,
|
||||
2:11534237,
|
||||
3:10350847,
|
||||
4:16738047,
|
||||
5:16763904
|
||||
};
|
||||
|
||||
public function CP()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function mon(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#ff6600",null,true);
|
||||
}
|
||||
|
||||
public static function darkBlue(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#005672",null,true);
|
||||
}
|
||||
|
||||
public static function lightYellow(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#f6ffb7",null,true);
|
||||
}
|
||||
|
||||
public static function money(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#ce8800",null,true);
|
||||
}
|
||||
|
||||
public static function gold(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#ffde00",null,true);
|
||||
}
|
||||
|
||||
public static function item(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#ca5000",null,true);
|
||||
}
|
||||
|
||||
public static function red(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#884444",null,true);
|
||||
}
|
||||
|
||||
public static function itemNeedRed(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#FF3E3E");
|
||||
}
|
||||
|
||||
public static function ke(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#be3cd5",null,true);
|
||||
}
|
||||
|
||||
public static function ti(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#006600",null,true);
|
||||
}
|
||||
|
||||
public static function task(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#0066CC",null,true);
|
||||
}
|
||||
|
||||
public static function taskTitle(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#fdff78");
|
||||
}
|
||||
|
||||
public static function exp(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#33CC00",null,true);
|
||||
}
|
||||
|
||||
public static function GREEN(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#aeff00",null,true);
|
||||
}
|
||||
|
||||
public static function room(text:String) : String
|
||||
{
|
||||
return Paster.font(text,"#FF66FF",null,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,603 @@
|
||||
package net.pixvi.myr
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.view.attack.type.AttackType;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Counter;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class GameMath
|
||||
{
|
||||
|
||||
public static const ModeEvent:Boolean = false;
|
||||
|
||||
public static var ModeTrace:Boolean = false;
|
||||
|
||||
public static var ModeTraceOpened:Boolean = false;
|
||||
|
||||
public static var ModeTraceServer:Boolean = false;
|
||||
|
||||
public static var ModeCrypto:Boolean = true;
|
||||
|
||||
public static var ModeNetCrypto:Boolean = true;
|
||||
|
||||
public static var ModePayCrypto:Boolean = true;
|
||||
|
||||
private static var modereal:Object = null;
|
||||
|
||||
public static var quickLogin:Boolean = false;
|
||||
|
||||
public static const waveSpaceTime:int = 700;
|
||||
|
||||
public static const numScale:Number = 4;
|
||||
|
||||
public function GameMath()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get ModeRealName() : Boolean
|
||||
{
|
||||
if(modereal != null)
|
||||
{
|
||||
return modereal;
|
||||
}
|
||||
if(Table.setting.safeModePlatform != null && Table.setting.safeModePlatform.indexOf(MyrCenter.platform) == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(MyrCenter.closeRealName == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(MyrCenter.channel == "DYD")
|
||||
{
|
||||
modereal = true;
|
||||
return true;
|
||||
}
|
||||
modereal = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function get OpenPay() : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function get critAdd() : Number
|
||||
{
|
||||
return Table.game_setting.critAdd;
|
||||
}
|
||||
|
||||
public static function get counterAdd() : Number
|
||||
{
|
||||
return Table.game_setting.counterAdd;
|
||||
}
|
||||
|
||||
public static function get apCD() : int
|
||||
{
|
||||
return Table.game_setting.apCD;
|
||||
}
|
||||
|
||||
public static function get tiCD() : int
|
||||
{
|
||||
return Table.game_setting.tiCD;
|
||||
}
|
||||
|
||||
public static function get apCostByStar() : Array
|
||||
{
|
||||
return Table.game_setting.apCostByStar;
|
||||
}
|
||||
|
||||
public static function get maxFeel() : int
|
||||
{
|
||||
return Table.game_setting.maxFeel;
|
||||
}
|
||||
|
||||
public static function get monGiftTime() : int
|
||||
{
|
||||
return Table.game_setting.monGiftTime;
|
||||
}
|
||||
|
||||
public static function get monGiftMax() : int
|
||||
{
|
||||
return Table.game_setting.monGiftMax;
|
||||
}
|
||||
|
||||
public static function get masterMaxLevel() : int
|
||||
{
|
||||
return Table.game_setting.masterMaxLevel;
|
||||
}
|
||||
|
||||
public static function get loopTaskMaxNum() : int
|
||||
{
|
||||
return Table.game_setting.loopTaskMaxNum;
|
||||
}
|
||||
|
||||
public static function get farmEventTime() : int
|
||||
{
|
||||
return Table.game_setting.farmEventTime;
|
||||
}
|
||||
|
||||
public static function get normalBattleTime() : int
|
||||
{
|
||||
return Table.game_setting.normalBattleTime;
|
||||
}
|
||||
|
||||
public static function get countDamagePerAtk() : Number
|
||||
{
|
||||
return Table.game_setting.countDamagePerAtk;
|
||||
}
|
||||
|
||||
public static function get countGuardPerDef() : Number
|
||||
{
|
||||
return Table.game_setting.countGuardPerDef;
|
||||
}
|
||||
|
||||
public static function get tpExp() : Object
|
||||
{
|
||||
return Table.game_setting.tpExp;
|
||||
}
|
||||
|
||||
public static function get maxTpLevel() : int
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public static function get alchemyFormulaLevel() : Array
|
||||
{
|
||||
return Table.game_setting.alchemyFormulaLevel;
|
||||
}
|
||||
|
||||
public static function get alchemyFormulaCost() : Object
|
||||
{
|
||||
return Table.game_setting.alchemyFormulaCost;
|
||||
}
|
||||
|
||||
public static function get feedExpScale() : Number
|
||||
{
|
||||
return Table.game_setting.monExpScale;
|
||||
}
|
||||
|
||||
public static function get equipNumFloat() : Number
|
||||
{
|
||||
return Table.game_setting.equipNumFloat;
|
||||
}
|
||||
|
||||
public static function get speedItemId() : int
|
||||
{
|
||||
return Table.game_setting.monSpeedItemId;
|
||||
}
|
||||
|
||||
public static function get alchemySpeedItemId() : int
|
||||
{
|
||||
return Table.game_setting.alchemySpeedItemId;
|
||||
}
|
||||
|
||||
public static function get equipNum() : int
|
||||
{
|
||||
return Table.game_setting.equipNum;
|
||||
}
|
||||
|
||||
public static function get monSpeedItemTime() : int
|
||||
{
|
||||
return Table.game_setting.monSpeedItemTime;
|
||||
}
|
||||
|
||||
public static function get monExpScale() : int
|
||||
{
|
||||
return Table.game_setting.monExpScale;
|
||||
}
|
||||
|
||||
public static function apByLevel(lv:int) : int
|
||||
{
|
||||
return Table.game_setting.startAp + (lv - 1) * Table.game_setting.addApByLevel;
|
||||
}
|
||||
|
||||
public static function tiMaxByLevel(lv:int) : int
|
||||
{
|
||||
var timax:int = Table.game_setting.tiFirst + (lv - 1) * Table.game_setting.tiLevelAdd;
|
||||
if(timax > Table.game_setting.tiTotalMax)
|
||||
{
|
||||
return Table.game_setting.tiTotalMax;
|
||||
}
|
||||
return timax;
|
||||
}
|
||||
|
||||
public static function get_apCost(star:int) : int
|
||||
{
|
||||
return Table.game_setting.apCostByStar[star - 1];
|
||||
}
|
||||
|
||||
public static function damage(atkA:int, dexA:int, dexB:int, defB:int, defDamaB:Number = 0) : int
|
||||
{
|
||||
var dexp:int = dexA - dexB;
|
||||
var dam:int = 0;
|
||||
var minp:Number = 0.8;
|
||||
var maxp:Number = 1.2;
|
||||
var maxa:int = 80;
|
||||
if(dexp > 0)
|
||||
{
|
||||
if(dexp > maxa)
|
||||
{
|
||||
dexp = maxa;
|
||||
}
|
||||
minp += 0.3 * dexp / maxa;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dexp < -maxa)
|
||||
{
|
||||
dexp = -maxa;
|
||||
}
|
||||
maxp += 0.3 * dexp / maxa;
|
||||
}
|
||||
dam = Math.round(atkA * countDamagePerAtk * Random.number(minp,maxp) - defB * (countGuardPerDef * 0.75 + Random.number(0,countGuardPerDef * 0.25)));
|
||||
dam *= 1 - defDamaB;
|
||||
if(dam < 1)
|
||||
{
|
||||
dam = 1;
|
||||
}
|
||||
return dam;
|
||||
}
|
||||
|
||||
public static function fix_spd_atk(atk_spd:int) : int
|
||||
{
|
||||
return atk_spd;
|
||||
}
|
||||
|
||||
public static function cost_speedGrow(s:int) : int
|
||||
{
|
||||
return Math.ceil(s / 120);
|
||||
}
|
||||
|
||||
public static function cost_speedAlchemy(s:int) : int
|
||||
{
|
||||
return Math.ceil(s / 120);
|
||||
}
|
||||
|
||||
public static function addSecondByCost(cost:int) : int
|
||||
{
|
||||
return cost * 120;
|
||||
}
|
||||
|
||||
public static function critByDex(crit:Number, dexA:int, dexB:int) : Number
|
||||
{
|
||||
var dexp:int = (dexA - dexB) / 4;
|
||||
if(dexp < 0)
|
||||
{
|
||||
return 0.02 + crit / 100;
|
||||
}
|
||||
return 0.02 + crit / 100 + dexp / (dexp + 120);
|
||||
}
|
||||
|
||||
public static function addAtkSpdByDex(dex:int) : int
|
||||
{
|
||||
return -(dex * 3) / 4;
|
||||
}
|
||||
|
||||
public static function addMovSpdByDex(dex:int) : Number
|
||||
{
|
||||
return Number((dex / (50 * 4)).toFixed(2));
|
||||
}
|
||||
|
||||
public static function addPowByAtk(atk:int) : Number
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function addPowDefByHp(hp:int) : Number
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function pveThornDmg(countDamage:int, thorn:int) : int
|
||||
{
|
||||
var a:int = 2;
|
||||
var b:int = 400;
|
||||
if(Table.game_setting.pveThornDmg_a != null)
|
||||
{
|
||||
a = int(Table.game_setting.pveThornDmg_a);
|
||||
}
|
||||
if(Table.game_setting.pveThornDmg_b != null)
|
||||
{
|
||||
b = int(Table.game_setting.pveThornDmg_b);
|
||||
}
|
||||
var dmg:int = countDamage * (thorn / (a * thorn + b));
|
||||
if(dmg < 1)
|
||||
{
|
||||
dmg = 1;
|
||||
}
|
||||
return dmg;
|
||||
}
|
||||
|
||||
public static function getFeedExpByMonsterVo(vo:MonsterVo) : int
|
||||
{
|
||||
return vo.sell_exp + int(vo.exp * GameMath.feedExpScale);
|
||||
}
|
||||
|
||||
public static function zl_atk(atk:Number, atk_spd:int = 1600) : int
|
||||
{
|
||||
if(1600 / atk_spd > 1)
|
||||
{
|
||||
return atk * 10 * (1 + (1600 / atk_spd - 1) * 0.7);
|
||||
}
|
||||
return atk * 10 * (1 - (1 - 1600 / atk_spd) * 0.8);
|
||||
}
|
||||
|
||||
public static function zl_def(def:Number) : int
|
||||
{
|
||||
return def * 5;
|
||||
}
|
||||
|
||||
public static function zl_hp(hp:Number) : int
|
||||
{
|
||||
return hp;
|
||||
}
|
||||
|
||||
public static function zl_dex(dex:Number) : int
|
||||
{
|
||||
return dex * 10;
|
||||
}
|
||||
|
||||
public static function zl_atkSpd(atkspd:Number) : int
|
||||
{
|
||||
return atkspd * 20;
|
||||
}
|
||||
|
||||
public static function zl_atkVim(atkvim:Number) : int
|
||||
{
|
||||
return atkvim * 50;
|
||||
}
|
||||
|
||||
public static function zl_selfCure(selfCure:Number) : int
|
||||
{
|
||||
return selfCure * 6;
|
||||
}
|
||||
|
||||
public static function zl_deadBoom(deadBoom:Number) : int
|
||||
{
|
||||
return int(deadBoom * 1.5);
|
||||
}
|
||||
|
||||
public static function zl_atkStun(atkStunChance:Number) : int
|
||||
{
|
||||
return atkStunChance * 20;
|
||||
}
|
||||
|
||||
public static function zl_defStun(defStunChance:Number) : int
|
||||
{
|
||||
return defStunChance * 30;
|
||||
}
|
||||
|
||||
public static function zl_atkPoi(atkPoiChance:Number, atkPoiDamage:*) : int
|
||||
{
|
||||
return atkPoiChance * 10 + atkPoiDamage * 2;
|
||||
}
|
||||
|
||||
public static function zl_apCostSave(apCostSave:int) : int
|
||||
{
|
||||
return apCostSave * 150;
|
||||
}
|
||||
|
||||
public static function zl_sunFire(sunFire:int) : int
|
||||
{
|
||||
return sunFire * 4;
|
||||
}
|
||||
|
||||
public static function zl_moonHeal(moonHeal:int) : int
|
||||
{
|
||||
return moonHeal * 10;
|
||||
}
|
||||
|
||||
public static function zl_crit(crit:Number) : int
|
||||
{
|
||||
return crit * 30;
|
||||
}
|
||||
|
||||
public static function zl_skillCooldown(skillCooldown:Number) : int
|
||||
{
|
||||
return skillCooldown * 20;
|
||||
}
|
||||
|
||||
public static function zl_thorns(thorns:int) : int
|
||||
{
|
||||
return thorns * 2;
|
||||
}
|
||||
|
||||
public static function zl_editMon(mon:Object, abilityScale:Number = 1, hpScale:Number = 1) : int
|
||||
{
|
||||
var m:Object = null;
|
||||
var zl:int = 0;
|
||||
var moveImmune:Boolean = Boolean(mon.moveImmune);
|
||||
var mode:int = int(mon.mode);
|
||||
var teampos:int = int(mon.teamPos);
|
||||
if(mon.autoValue)
|
||||
{
|
||||
m = new MonsterVo();
|
||||
m.editorInit(mon.type);
|
||||
m.buildByArea();
|
||||
m.level = mon.level;
|
||||
mon = m;
|
||||
}
|
||||
zl = hpScale * zl_hp(mon.hp) + abilityScale * (zl_def(mon.def) + zl_dex(mon.dex) + zl_atk(mon.atk,mon.spd_atk));
|
||||
if(moveImmune)
|
||||
{
|
||||
if(!AttackType.isShooter(mon.type,mode))
|
||||
{
|
||||
return int(zl * 0.25);
|
||||
}
|
||||
zl *= 0.8;
|
||||
}
|
||||
if(teampos >= 6)
|
||||
{
|
||||
zl *= 0.8;
|
||||
}
|
||||
return zl;
|
||||
}
|
||||
|
||||
public static function zl_battleMonVo(mon:Object) : int
|
||||
{
|
||||
return int(zl_hp(mon.hp) + zl_def(mon.def) + zl_dex(mon.dex) + zl_atk(mon.atk,mon.spd_atk));
|
||||
}
|
||||
|
||||
public static function zl_monVo(monvo:MonsterVo) : int
|
||||
{
|
||||
var zl:int = zl_hp(monvo.hp) + zl_def(monvo.def) + zl_dex(monvo.dex) + zl_atk(monvo.atk);
|
||||
zl += zl_atkSpd(monvo.allAdd("atkSpd"));
|
||||
zl += zl_crit(monvo.allAdd("crit"));
|
||||
zl += zl_selfCure(monvo.allAdd("selfCure"));
|
||||
zl += zl_atkVim(monvo.allAdd("atkVim"));
|
||||
zl += zl_atkStun(monvo.allAdd("atkStun"));
|
||||
zl += zl_defStun(monvo.allAdd("defStun"));
|
||||
zl += zl_atkPoi(monvo.allAdd("atkPoi"),monvo.allAdd("atkPoiDmg"));
|
||||
zl += zl_skillCooldown(monvo.allAdd("skillCooldown"));
|
||||
zl += zl_sunFire(monvo.allAdd("sunFire"));
|
||||
zl += zl_moonHeal(monvo.allAdd("moonHeal"));
|
||||
zl += zl_deadBoom(monvo.allAdd("deadBoom"));
|
||||
return int(zl + zl_thorns(monvo.allAdd("thorns")));
|
||||
}
|
||||
|
||||
public static function zl_battle(battle:Object) : int
|
||||
{
|
||||
var zl:int = 0;
|
||||
var arr:Array = null;
|
||||
try
|
||||
{
|
||||
zl = 0;
|
||||
arr = battle.teams[0].mons;
|
||||
for each(var mo:Object in arr)
|
||||
{
|
||||
if(!(mo is int) && mo.team == 2 && mo != null)
|
||||
{
|
||||
if(battle.scaleAbility == null)
|
||||
{
|
||||
battle.scaleAbility = 1;
|
||||
}
|
||||
if(battle.scaleHp == null)
|
||||
{
|
||||
battle.scaleHp = 1;
|
||||
}
|
||||
zl += zl_editMon(mo,battle.scaleAbility,battle.scaleHp);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return zl;
|
||||
}
|
||||
|
||||
public static function zl_battle_onstage(battle:Object) : int
|
||||
{
|
||||
var zl:int = 0;
|
||||
var arr:Array = battle.teams[0].mons;
|
||||
for each(var mo:Object in arr)
|
||||
{
|
||||
if(!(mo is int) && mo.team == 2 && mo != null && mo.teamPos < 6)
|
||||
{
|
||||
if(battle.scaleAbility == null)
|
||||
{
|
||||
battle.scaleAbility = 1;
|
||||
}
|
||||
if(battle.scaleHp == null)
|
||||
{
|
||||
battle.scaleHp = 1;
|
||||
}
|
||||
zl += zl_editMon(mo,battle.scaleAbility,battle.scaleHp);
|
||||
}
|
||||
}
|
||||
return zl;
|
||||
}
|
||||
|
||||
public static function feelAdd(feel:int) : Number
|
||||
{
|
||||
return Counter.getAreaByArea(0,0.1,0,200,feel,true);
|
||||
}
|
||||
|
||||
public static function isVipGood(goodId:String) : Boolean
|
||||
{
|
||||
if(goodId == "301")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getSwitchMoney(star:int) : int
|
||||
{
|
||||
return Table.game_setting.monSwitchCost[star - 1];
|
||||
}
|
||||
|
||||
public static function getGrowUpFarmExp(montype:int) : int
|
||||
{
|
||||
var exp:int = (int(Table.monster_info[montype].time_1) + int(Table.monster_info[montype].time_2)) / 1200;
|
||||
if(exp < 1)
|
||||
{
|
||||
exp = 1;
|
||||
}
|
||||
return exp;
|
||||
}
|
||||
|
||||
public static function getMonMaxLevel(potentialLevel:int) : int
|
||||
{
|
||||
return potentialLevel * Table.potential_info.potentialLevelMaxAdd;
|
||||
}
|
||||
|
||||
public static function getStageNumByLevel(level:int) : int
|
||||
{
|
||||
var stageNum:int = 2;
|
||||
if(level >= Table.team_info.battleTeam[2].level)
|
||||
{
|
||||
stageNum++;
|
||||
}
|
||||
if(level >= Table.team_info.battleTeam[3].level)
|
||||
{
|
||||
stageNum++;
|
||||
}
|
||||
return stageNum;
|
||||
}
|
||||
|
||||
public static function getLevelByStageNum(stageNum:*) : int
|
||||
{
|
||||
if(stageNum <= 2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(stageNum <= 3)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
if(stageNum <= 4)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
return 12;
|
||||
}
|
||||
|
||||
public static function getEquipZdl(equip:Object) : int
|
||||
{
|
||||
var zdl:int = 0;
|
||||
zdl += zl_atk(equip.atk);
|
||||
zdl += zl_def(equip.def);
|
||||
zdl += zl_hp(equip.hp);
|
||||
zdl += zl_dex(equip.dex);
|
||||
zdl += zl_crit(equip.crit);
|
||||
zdl += zl_atkSpd(equip.atkSpd);
|
||||
zdl += zl_atkVim(equip.atkVim);
|
||||
zdl += zl_selfCure(equip.selfCure);
|
||||
zdl += zl_deadBoom(equip.deadBoom);
|
||||
zdl += zl_atkStun(equip.atkStun);
|
||||
zdl += zl_defStun(equip.defStun);
|
||||
zdl += zl_atkPoi(equip.atkPoi,equip.atkPoiDmg);
|
||||
zdl += zl_apCostSave(equip.apCostSave);
|
||||
zdl += zl_skillCooldown(equip.skillCooldown);
|
||||
zdl += zl_sunFire(equip.sunFire);
|
||||
zdl += zl_moonHeal(equip.moonHeal);
|
||||
return int(zdl + zl_thorns(equip.thorns));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.pixvi.myr
|
||||
{
|
||||
public class GamePool
|
||||
{
|
||||
|
||||
public function GamePool()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function startUp() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr
|
||||
{
|
||||
import flash.geom.Rectangle;
|
||||
|
||||
public class GameSetting
|
||||
{
|
||||
|
||||
public static var Y_DISTANCE_SCALE:Number = 0.5;
|
||||
|
||||
public static var attackImgWaitTime:int = 300;
|
||||
|
||||
public static var MainUITopHeight:int = 44;
|
||||
|
||||
public static var MainUIBottomHeight:int = 60;
|
||||
|
||||
public static var BottomMenuSpace:Number = 23;
|
||||
|
||||
public static var PanelTransTime:Number = 0.3;
|
||||
|
||||
public static var BattleStartCD:int = 7;
|
||||
|
||||
public function GameSetting()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function fixDragRecWithMainUI(rec:Rectangle, scaleY:Number = 1, checkHeight:Boolean = true) : void
|
||||
{
|
||||
if(rec.height != 0 || !checkHeight)
|
||||
{
|
||||
rec.y -= GameSetting.MainUIBottomHeight / scaleY;
|
||||
rec.height += (GameSetting.MainUIBottomHeight + GameSetting.MainUITopHeight) / scaleY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.myr.battle.view.BattleMonItem;
|
||||
import net.pixvi.myr.battle.view.BattleSkillUI;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiDataList;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattleGroundBottomUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_ap:PiBitTextField;
|
||||
|
||||
public var bar_ap:PiBar;
|
||||
|
||||
public var list_team1:PiDataList;
|
||||
|
||||
public var ui_skill1:BattleSkillUI;
|
||||
|
||||
public var ui_skill2:BattleSkillUI;
|
||||
|
||||
public var mc_autoSkill:MovieClip;
|
||||
|
||||
public var btn_autoSkill:PiLightButton;
|
||||
|
||||
public function BattleGroundBottomUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
list_team1.itemClass = BattleMonItem;
|
||||
}
|
||||
|
||||
public function autoSkillMode(open:Boolean = true) : void
|
||||
{
|
||||
if(open)
|
||||
{
|
||||
btn_autoSkill.selected = true;
|
||||
mc_autoSkill.play();
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_autoSkill.selected = false;
|
||||
mc_autoSkill.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BattleMonVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class BattleGroundMonInfoUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public var bar_hp:PiBar;
|
||||
|
||||
public var text_hp:PiBitTextField;
|
||||
|
||||
public var container_avatar:PiImgContainer;
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var mc_board:MovieClip;
|
||||
|
||||
public function BattleGroundMonInfoUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
container_avatar.setSize(75,75);
|
||||
if(mc_board != null)
|
||||
{
|
||||
mc_board.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function onMon(mon:BattleMon) : void
|
||||
{
|
||||
if(mon.team == 1)
|
||||
{
|
||||
mc_board.gotoAndStop(mon.vo.quality);
|
||||
}
|
||||
text_level.htmlText = Paster.font("LV:",null,20) + Paster.font(mon.monVo.level.toString(),null,28);
|
||||
text_name.text = mon.monVo.name;
|
||||
bar_hp.setValue(mon.monVo.hp,mon.monVo.hpMax,0,false);
|
||||
text_hp.text = mon.monVo.hp + "/" + mon.monVo.hpMax;
|
||||
container_avatar.loadNetBitImg(mon.vo.getImg("avatar"),true,true,0);
|
||||
}
|
||||
|
||||
public function update(mon:BattleMon) : void
|
||||
{
|
||||
bar_hp.setValue(mon.monVo.hp,mon.monVo.hpMax,0,true);
|
||||
text_hp.text = mon.monVo.hp + "/" + mon.monVo.hpMax;
|
||||
}
|
||||
|
||||
public function updateByVo(monVo:BattleMonVo) : void
|
||||
{
|
||||
bar_hp.setValue(monVo.hp,monVo.hpMax,0,true);
|
||||
text_hp.text = monVo.hp + "/" + monVo.hpMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import com.greensock.easing.Expo;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.myr.battle.view.BattleBossPointUI;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattleGroundTopUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_time:PiBitTextField;
|
||||
|
||||
public var text_wait1:PiBitTextField;
|
||||
|
||||
public var text_wait2:PiBitTextField;
|
||||
|
||||
public var text_name1:PiBitTextField;
|
||||
|
||||
public var text_name2:PiBitTextField;
|
||||
|
||||
public var ui_bossPoint:BattleBossPointUI;
|
||||
|
||||
public var ui_info1:BattleGroundMonInfoUI;
|
||||
|
||||
public var ui_info2:BattleGroundMonInfoUI;
|
||||
|
||||
public var mc_proKill:Sprite;
|
||||
|
||||
public var mc_desKill:Sprite;
|
||||
|
||||
public var btn_pause:PiLightButton;
|
||||
|
||||
public function BattleGroundTopUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
mc_desKill.visible = mc_proKill.visible = false;
|
||||
ui_info1.visible = ui_info2.visible = false;
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
text_name1.scaleMode = true;
|
||||
text_name2.scaleMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function showProtectKill() : void
|
||||
{
|
||||
TweenMax.fromTo(mc_proKill,2,{
|
||||
"visible":true,
|
||||
"x":-87,
|
||||
"tint":16777215
|
||||
},{
|
||||
"x":-47,
|
||||
"tint":null,
|
||||
"visible":false,
|
||||
"ease":Expo.easeOut
|
||||
});
|
||||
TweenMax.fromTo(mc_proKill,2,{"alpha":1},{
|
||||
"delay":1,
|
||||
"alpha":0,
|
||||
"Ease":Expo.easeIn
|
||||
});
|
||||
}
|
||||
|
||||
public function showDestroyKill() : void
|
||||
{
|
||||
TweenMax.fromTo(mc_desKill,2,{
|
||||
"visible":true,
|
||||
"x":441,
|
||||
"tint":16777215
|
||||
},{
|
||||
"x":401,
|
||||
"tint":null,
|
||||
"visible":false,
|
||||
"ease":Expo.easeOut
|
||||
});
|
||||
TweenMax.fromTo(mc_desKill,1,{"alpha":1},{
|
||||
"delay":1,
|
||||
"alpha":0,
|
||||
"Ease":Expo.easeIn
|
||||
});
|
||||
}
|
||||
|
||||
public function updateByMon(mon:BattleMon) : void
|
||||
{
|
||||
if(mon.team == 1)
|
||||
{
|
||||
ui_info1.onMon(mon);
|
||||
ui_info1.visible = true;
|
||||
ui_info2.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_info1.visible = false;
|
||||
ui_info2.onMon(mon);
|
||||
ui_info2.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function updateHpByMon(mon:BattleMon) : void
|
||||
{
|
||||
var info:BattleGroundMonInfoUI = null;
|
||||
if(mon.team == 1)
|
||||
{
|
||||
info = ui_info1;
|
||||
}
|
||||
else
|
||||
{
|
||||
info = ui_info2;
|
||||
}
|
||||
info.update(mon);
|
||||
}
|
||||
|
||||
public function lostSelect() : void
|
||||
{
|
||||
ui_info1.visible = ui_info2.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.utils.PiFixVo;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
|
||||
public class BattleGroundUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_area:MovieClip;
|
||||
|
||||
public var mc_bg:Sprite;
|
||||
|
||||
public var bg:NetBitImg;
|
||||
|
||||
public var ui_bottom:BattleGroundBottomUI;
|
||||
|
||||
public var ui_top:BattleGroundTopUI;
|
||||
|
||||
public var onBuildTypeComplete:Function;
|
||||
|
||||
public function BattleGroundUI(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
if(skin == null)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleGroundUI");
|
||||
}
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_bg = new Sprite();
|
||||
addChildAt(mc_bg,0);
|
||||
ui_bottom.mouseChildren = ui_bottom.mouseEnabled = true;
|
||||
ui_top.mouseChildren = ui_top.mouseEnabled = false;
|
||||
ui_top.btn_pause.sound_click = GameSound.effect_click1;
|
||||
StageDriver.getInstance().regist(onStageChange);
|
||||
var fixvo:PiFixVo = StageLocator.SubFixVos["fs2"];
|
||||
StageLocator.setSide(ui_top,"none","top",0,-10,fixvo);
|
||||
StageLocator.setSide(ui_top.btn_pause,"none","top",0,-2,fixvo);
|
||||
StageLocator.setSide(ui_bottom,"none","bottom",0,-21,fixvo);
|
||||
}
|
||||
|
||||
public function buildByType(type:String, onComplete:Function) : void
|
||||
{
|
||||
onBuildTypeComplete = onComplete;
|
||||
bg = new NetBitImg();
|
||||
bg.addEventListener("complete",buildByTypeCompleteHandler);
|
||||
bg.load(ImgCenter.getBattleImgByGroundType(type.toString()));
|
||||
mc_bg.addChild(bg);
|
||||
}
|
||||
|
||||
private function buildByTypeCompleteHandler(e:Event = null) : void
|
||||
{
|
||||
onBuildTypeComplete();
|
||||
onBuildTypeComplete = null;
|
||||
}
|
||||
|
||||
public function gc() : void
|
||||
{
|
||||
bg.unloadMapping();
|
||||
}
|
||||
|
||||
public function onStageChange() : void
|
||||
{
|
||||
StageLocator.setSide(ui_bottom,"none","bottom",0,-25);
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
gc();
|
||||
StageDriver.getInstance().remove(onStageChange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
public class BattleModeType
|
||||
{
|
||||
|
||||
public static var NORMAL:int = 0;
|
||||
|
||||
public static var PVE:int = 1;
|
||||
|
||||
public static var BOSS:int = 2;
|
||||
|
||||
public function BattleModeType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package net.pixvi.myr.battle
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class BattleStartTipUI extends UIComponent
|
||||
{
|
||||
|
||||
public static var winDicColor:Object = {
|
||||
"2":"#ffff00",
|
||||
"3":"#ffff00",
|
||||
"4":"#ffff00"
|
||||
};
|
||||
|
||||
public static var loseDicColor:Object = {
|
||||
"3":"#ffff00",
|
||||
"4":"#ffff00"
|
||||
};
|
||||
|
||||
public var text_winType:PiBitTextField;
|
||||
|
||||
public var text_loseType:PiBitTextField;
|
||||
|
||||
public var mc_longMap:Sprite;
|
||||
|
||||
public var text_countDown:PiBitTextField;
|
||||
|
||||
public function BattleStartTipUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleTipPanelUI");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
public static function get winDic() : Object
|
||||
{
|
||||
return {
|
||||
"1":lang("◆消灭所有敌人"),
|
||||
"2":lang("◆坚守到战斗结束"),
|
||||
"3":lang("◆消灭任意指定目标"),
|
||||
"4":lang("◆消灭所有指定目标")
|
||||
};
|
||||
}
|
||||
|
||||
public static function get loseDic() : Object
|
||||
{
|
||||
return {
|
||||
"1":lang("◆我方全灭"),
|
||||
"2":lang("◆战斗时间结束"),
|
||||
"3":lang("◆任意保护目标被消灭"),
|
||||
"4":lang("◆所有保护目标被消灭")
|
||||
};
|
||||
}
|
||||
|
||||
public function showType(vo:BattleVo) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var wintype:String = "";
|
||||
var losetype:String = "";
|
||||
for(i = 0; i < vo.winType.length; )
|
||||
{
|
||||
if(i != 0)
|
||||
{
|
||||
wintype += "<br/>";
|
||||
}
|
||||
if(winDicColor[vo.winType[i.toString()]] != null)
|
||||
{
|
||||
wintype += Paster.font(winDic[vo.winType[i.toString()]],winDicColor[vo.winType[i.toString()]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
wintype += winDic[vo.winType[i]];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(vo.rollmapMode)
|
||||
{
|
||||
mc_longMap.visible = true;
|
||||
TweenMax.from(mc_longMap,0.5,{
|
||||
"alpha":0,
|
||||
"y":mc_longMap.y + 50
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
mc_longMap.visible = false;
|
||||
}
|
||||
j = 0;
|
||||
while(j < vo.loseType.length)
|
||||
{
|
||||
if(j != 0)
|
||||
{
|
||||
losetype += "<br/>";
|
||||
}
|
||||
if(loseDicColor[vo.loseType[j.toString()]] != null)
|
||||
{
|
||||
losetype += Paster.font(loseDic[vo.loseType[j.toString()]],loseDicColor[vo.loseType[j.toString()]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
losetype += loseDic[vo.loseType[j]];
|
||||
}
|
||||
j++;
|
||||
}
|
||||
text_loseType.htmlText = losetype;
|
||||
text_winType.htmlText = wintype;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleBossPointUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_bossPoint:PiBitTextField;
|
||||
|
||||
public var text_pointName:PiBitTextField;
|
||||
|
||||
public function BattleBossPointUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.utils.Timer;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBar;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleMonInfoUI extends UIComponent
|
||||
{
|
||||
|
||||
public var bar_hp:PiBar;
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var mc_shooter:MovieClip;
|
||||
|
||||
private var _keepShow:Boolean = false;
|
||||
|
||||
private var showTimer:Timer;
|
||||
|
||||
public var importantTarget:Boolean = false;
|
||||
|
||||
public var text_name:PiBitTextField;
|
||||
|
||||
public function BattleMonInfoUI(team:int = 1)
|
||||
{
|
||||
var skin:DisplayObject = null;
|
||||
if(team == 1)
|
||||
{
|
||||
skin = FF.getMC("ui.BattleMonInfoUIGreen");
|
||||
}
|
||||
else
|
||||
{
|
||||
skin = FF.getMC("ui.BattleMonInfoUIRed");
|
||||
}
|
||||
super(skin);
|
||||
this.setScale(0.75);
|
||||
showTimer = new Timer(1500,1);
|
||||
showTimer.addEventListener("timerComplete",timerComplete);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_name.scaleMode = true;
|
||||
super.onSkinComplete();
|
||||
bar_hp.buffTime = 0.15;
|
||||
}
|
||||
|
||||
public function showIcon(icon:String) : void
|
||||
{
|
||||
var bm:BitMovieClip = FF.getBMC(icon);
|
||||
bm.mouseChildren = bm.mouseEnabled = false;
|
||||
addChild(bm);
|
||||
}
|
||||
|
||||
private function timerComplete(e:Event = null) : void
|
||||
{
|
||||
if(!_keepShow)
|
||||
{
|
||||
hideHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function set keepShow(show:Boolean) : void
|
||||
{
|
||||
_keepShow = show;
|
||||
if(show)
|
||||
{
|
||||
showHp();
|
||||
}
|
||||
else
|
||||
{
|
||||
hideHp();
|
||||
}
|
||||
}
|
||||
|
||||
public function showHpSomeTime() : void
|
||||
{
|
||||
showHp();
|
||||
showTimer.reset();
|
||||
showTimer.start();
|
||||
}
|
||||
|
||||
public function showHp() : void
|
||||
{
|
||||
this.visible = true;
|
||||
}
|
||||
|
||||
public function hideHp() : void
|
||||
{
|
||||
if(!importantTarget)
|
||||
{
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.utils.Gesturer;
|
||||
import net.pixvi.myr.center.ImgCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.event.MobiEvent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.ui.controls.PiListItem;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.psg.ui.controller.PiLightButton;
|
||||
|
||||
public class BattleMonItem extends PiListItem
|
||||
{
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var img_select:Sprite;
|
||||
|
||||
public var container_img:PiImgContainer;
|
||||
|
||||
public var boardimg:NetBitImg;
|
||||
|
||||
public var curmon:BattleMon;
|
||||
|
||||
public var gesture:Gesturer;
|
||||
|
||||
public function BattleMonItem(skin:DisplayObject = null, auto:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,auto,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
img_select.visible = false;
|
||||
container_img.setSize(75,75);
|
||||
PiLightButton.btnTouchLight.setDisplay(this);
|
||||
super.onSkinComplete();
|
||||
gesture = new Gesturer(skin,true);
|
||||
gesture.dragLength = 80;
|
||||
gesture.addEventListener(Gesturer.DRAG,dragHandler);
|
||||
gesture.start();
|
||||
}
|
||||
|
||||
private function dragHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattlePanel.getIns().ground.battleIsStart || BattlePanel.getIns().ground.paused || !(_data as BattleMon).moveable || (_data as BattleMon).monVo.isObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(_data != null)
|
||||
{
|
||||
(_data as BattleMon).dragHandler();
|
||||
}
|
||||
}
|
||||
|
||||
override public function onData(value:Object) : void
|
||||
{
|
||||
var battlemon:BattleMon = value as BattleMon;
|
||||
if(curmon == battlemon)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(curmon != null && (curmon.monVo.type != battlemon.monVo.type || curmon.monVo.mode != battlemon.monVo.mode))
|
||||
{
|
||||
if(boardimg != null)
|
||||
{
|
||||
boardimg.dispose();
|
||||
}
|
||||
}
|
||||
boardimg = new NetBitImg(ImgCenter.getBattleMonBoard(battlemon.vo.quality));
|
||||
container_img.parent.addChildAt(boardimg,container_img.parent.getChildIndex(container_img) + 1);
|
||||
curmon = battlemon;
|
||||
text_level.htmlText = Paster.font("LV:",null,20) + Paster.font(battlemon.monVo.level.toString(),null,28);
|
||||
container_img.loadNetBitImg(battlemon.vo.getImg("avatar"),true,true,0);
|
||||
this.addEventListener(MobiEvent.CLICK,clickHandler);
|
||||
}
|
||||
|
||||
public function clickHandler(e:Event = null) : void
|
||||
{
|
||||
if(!BattlePanel.getIns().ground.battleIsStart)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sendSelect();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
curmon = null;
|
||||
gesture.dispose();
|
||||
PiLightButton.btnTouchLight.removeDisplay(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
override public function set selected(value:Boolean) : void
|
||||
{
|
||||
img_select.visible = value;
|
||||
super.selected = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
public class BattleMonRecordVo
|
||||
{
|
||||
|
||||
public var maxDamage:Number = 0;
|
||||
|
||||
public var avgDamage:Number = 0;
|
||||
|
||||
public var totalCure:Number = 0;
|
||||
|
||||
public var mid:String;
|
||||
|
||||
public var atk:Number;
|
||||
|
||||
public var def:Number;
|
||||
|
||||
public var hp:Number;
|
||||
|
||||
public var buffAtk:Number;
|
||||
|
||||
public var buffDefDama:Number;
|
||||
|
||||
public var hpMax:Number;
|
||||
|
||||
public var dex:Number;
|
||||
|
||||
public var selfCure:Number;
|
||||
|
||||
public var atkVim:Number;
|
||||
|
||||
public var atkStun:Number;
|
||||
|
||||
public var defStun:Number;
|
||||
|
||||
public var atkPoi:Number;
|
||||
|
||||
public var atkPoiDmg:Number;
|
||||
|
||||
public var skillCooldown:Number;
|
||||
|
||||
public var sunFire:Number;
|
||||
|
||||
public var moonHeal:Number;
|
||||
|
||||
public var deadBoom:Number;
|
||||
|
||||
public var thorns:Number;
|
||||
|
||||
public var crit:Number;
|
||||
|
||||
public var totalDmg:Number = 0;
|
||||
|
||||
public var monsterVo:Object;
|
||||
|
||||
public var skillLevel1:Number;
|
||||
|
||||
public var skillLevel2:Number;
|
||||
|
||||
public function BattleMonRecordVo()
|
||||
{
|
||||
super();
|
||||
totalDmg = 0;
|
||||
}
|
||||
|
||||
public function recordDmg(dmg:int) : void
|
||||
{
|
||||
if(maxDamage < dmg)
|
||||
{
|
||||
maxDamage = dmg;
|
||||
}
|
||||
totalDmg += dmg;
|
||||
}
|
||||
|
||||
public function recordCure(cure:int) : void
|
||||
{
|
||||
totalCure += cure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.text.TextField;
|
||||
import net.pixvi.common.center.TipCenter;
|
||||
import net.pixvi.common.driver.TipDriver;
|
||||
import net.pixvi.myr.event.BattleEvent;
|
||||
import net.pixvi.myr.view.skill.BaseSkill;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.driver.EnterFrameDriver;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.containers.PiImgContainer;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
import net.pixvi.pfw.utils.Colorator;
|
||||
import net.pixvi.pfw.utils.Jumper;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
|
||||
public class BattleSkillUI extends UIComponent
|
||||
{
|
||||
|
||||
public var mc_container:PiImgContainer;
|
||||
|
||||
public var text_level:PiBitTextField;
|
||||
|
||||
public var text_cost:PiBitTextField;
|
||||
|
||||
public var text_cd:TextField;
|
||||
|
||||
public var img:NetBitImg;
|
||||
|
||||
public var curSkill:BaseSkill;
|
||||
|
||||
public var dark:Boolean = false;
|
||||
|
||||
public var cdjump:Jumper = new Jumper(5);
|
||||
|
||||
public function BattleSkillUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
super.onSkinComplete();
|
||||
mc_container.setSize(89,91);
|
||||
mc_container.x += 5;
|
||||
lightMode(false);
|
||||
this.visible = false;
|
||||
}
|
||||
|
||||
public function onSkill(vo:BaseSkill) : void
|
||||
{
|
||||
if(vo == null)
|
||||
{
|
||||
this.visible = false;
|
||||
return;
|
||||
}
|
||||
curSkill = vo;
|
||||
this.visible = true;
|
||||
text_cost.text = vo.cost.toString();
|
||||
text_level.text = vo.lv.toString();
|
||||
mc_container.fillNetBitImg(vo.imgsrc);
|
||||
TipDriver.getInstance().regist(this,TipCenter.textTipLeft,vo.getTip(),1000);
|
||||
EnterFrameDriver.getInstance().regist(autoCheckMode);
|
||||
GlobalBroadcast.addEventListener(BattleEvent.MONSTER_SKILL,onSomeSkillHandler);
|
||||
}
|
||||
|
||||
private function onSomeSkillHandler(e:BattleEvent) : void
|
||||
{
|
||||
if(e.data == this.curSkill)
|
||||
{
|
||||
autoCheckMode();
|
||||
}
|
||||
}
|
||||
|
||||
public function autoCheckMode() : void
|
||||
{
|
||||
if(this.visible && curSkill != null)
|
||||
{
|
||||
if(curSkill.cder.cooldown)
|
||||
{
|
||||
lightMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
darkMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function darkMode(check:Boolean = true) : void
|
||||
{
|
||||
if(!dark || !check)
|
||||
{
|
||||
mc_container.transform.colorTransform = Colorator.createDarkTrans(0.3);
|
||||
dark = true;
|
||||
}
|
||||
text_cd.visible = true;
|
||||
var time:Number = curSkill.cder.leftTime / 1000;
|
||||
if(cdjump.jump())
|
||||
{
|
||||
if(time > 0)
|
||||
{
|
||||
if(time > 10)
|
||||
{
|
||||
text_cd.text = Math.floor(time).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
text_cd.text = time.toFixed(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
text_cd.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function lightMode(check:Boolean = true) : void
|
||||
{
|
||||
if(dark || !check)
|
||||
{
|
||||
mc_container.transform.colorTransform = Colorator.emptyColorTrans;
|
||||
dark = false;
|
||||
}
|
||||
text_cd.visible = false;
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
EnterFrameDriver.getInstance().remove(autoCheckMode);
|
||||
GlobalBroadcast.removeEventListener(BattleEvent.MONSTER_SKILL,onSomeSkillHandler);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
|
||||
public class BulletCureView extends BulletView
|
||||
{
|
||||
|
||||
public function BulletCureView()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function hit() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
target.beCure(1,this.atk);
|
||||
SoundCenter.getIns().play(GameSound.effect_skill_cure);
|
||||
}
|
||||
stop();
|
||||
this.dispose();
|
||||
this.remove = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.utils.getTimer;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.GameSetting;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.view.attack.BaseAttack;
|
||||
import net.pixvi.myr.view.attack.rocket.BaseBulletRocket;
|
||||
import net.pixvi.myr.view.attack.rocket.type.RocketType;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.Locator;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BulletView extends PiSprite
|
||||
{
|
||||
|
||||
public static const HIT_SPACE:int = 30;
|
||||
|
||||
public var target:BattleMon;
|
||||
|
||||
public var targetFloatX:int = 0;
|
||||
|
||||
public var targetFloatY:int = 0;
|
||||
|
||||
public var shooterFloatX:int = 0;
|
||||
|
||||
public var shooterFloatY:int = 0;
|
||||
|
||||
public var targetPoint:Object;
|
||||
|
||||
private var _atk:PointLocker = new PointLocker();
|
||||
|
||||
public var setpow:Number;
|
||||
|
||||
public var spd:Number;
|
||||
|
||||
public var master:BattleMon;
|
||||
|
||||
public var attack:BaseAttack;
|
||||
|
||||
public var img:BitMovieClip;
|
||||
|
||||
public var container:Sprite;
|
||||
|
||||
public var allDistance:Number;
|
||||
|
||||
public var remove:Boolean = false;
|
||||
|
||||
public var action:BaseBulletRocket;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public var atime:int = 0;
|
||||
|
||||
public var paused:Boolean = false;
|
||||
|
||||
public var force_crit:Boolean = false;
|
||||
|
||||
public var virtualBullet:Boolean = false;
|
||||
|
||||
public var skillBullet:Boolean = false;
|
||||
|
||||
public function BulletView()
|
||||
{
|
||||
super();
|
||||
this.mouseChildren = this.mouseEnabled = false;
|
||||
}
|
||||
|
||||
public function get atk() : int
|
||||
{
|
||||
return _atk.val;
|
||||
}
|
||||
|
||||
public function set atk(value:int) : void
|
||||
{
|
||||
_atk.val = value;
|
||||
}
|
||||
|
||||
public function init(target:BattleMon, master:BattleMon, attack:BaseAttack, setatk:int = -1, setpow:Number = -1) : void
|
||||
{
|
||||
this.target = target;
|
||||
this.master = master;
|
||||
this.attack = attack;
|
||||
if(setatk == -1)
|
||||
{
|
||||
atk = master.all_atk;
|
||||
}
|
||||
else
|
||||
{
|
||||
atk = setatk;
|
||||
}
|
||||
this.setpow = setpow;
|
||||
spd = attack.spd_bullet;
|
||||
targetFloatX = attack.targetFloatX;
|
||||
targetFloatY = attack.targetFloatY;
|
||||
shooterFloatX = attack.shooterFloatX * -master.curFaceto();
|
||||
shooterFloatY = attack.shooterFloatY;
|
||||
allDistance = Locator.getLength3D(target.x,target.y,target.container.y / GameSetting.Y_DISTANCE_SCALE,master.x,master.y,master.container.y / GameSetting.Y_DISTANCE_SCALE);
|
||||
buildView(attack.type_rocket,attack.movie_bullet);
|
||||
t = new TweenMax(this,allTime / 1000,{
|
||||
"x":target.x,
|
||||
"y":target.y,
|
||||
"ease":attack.ease,
|
||||
"onComplete":hit
|
||||
});
|
||||
start();
|
||||
}
|
||||
|
||||
public function getSpd() : Number
|
||||
{
|
||||
if(master != null)
|
||||
{
|
||||
return spd + spd * master.buff.get_movSpd;
|
||||
}
|
||||
return spd;
|
||||
}
|
||||
|
||||
public function lostTarget() : void
|
||||
{
|
||||
targetPoint = {
|
||||
"x":target.x,
|
||||
"y":target.y,
|
||||
"centerXSelf":target.centerXSelf,
|
||||
"centerYSelf":target.centerYSelf
|
||||
};
|
||||
target = null;
|
||||
}
|
||||
|
||||
public function buildView(typeRocket:String, movieBullet:String) : void
|
||||
{
|
||||
container = new Sprite();
|
||||
addChild(container);
|
||||
action = RocketType.getAttack(typeRocket);
|
||||
action.init(container);
|
||||
img = FF.getBMC(movieBullet);
|
||||
if(attack.bulletScale > 0)
|
||||
{
|
||||
img.setScale(attack.bulletScale);
|
||||
}
|
||||
container.addChild(img);
|
||||
container.y = master.container.y + shooterFloatY - master.monMov.height / 2;
|
||||
this.x = master.x + shooterFloatX;
|
||||
this.y = master.y;
|
||||
var shadow:Sprite = FF.getBS("img.Shadow");
|
||||
shadow.scaleX = shadow.scaleY = attack.shadowScale;
|
||||
addChildAt(shadow,0);
|
||||
}
|
||||
|
||||
public function step(e:Event = null) : void
|
||||
{
|
||||
if(paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(target != null)
|
||||
{
|
||||
t.updateTo({
|
||||
"x":target.x + targetFloatX,
|
||||
"y":target.y + targetFloatY
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t.updateTo({
|
||||
"x":targetPoint.x,
|
||||
"y":targetPoint.y
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
t.play();
|
||||
if(action != null)
|
||||
{
|
||||
action.start();
|
||||
}
|
||||
atime = getTimer();
|
||||
}
|
||||
|
||||
public function hit() : void
|
||||
{
|
||||
if(target != null)
|
||||
{
|
||||
if(!virtualBullet)
|
||||
{
|
||||
target.beAttack(master,this,-1,false,-1,skillBullet);
|
||||
}
|
||||
dispatchEvent(new MYREvent(MYREvent.BULLET_HIT,{"target":target}));
|
||||
}
|
||||
stop();
|
||||
this.dispose();
|
||||
this.remove = true;
|
||||
}
|
||||
|
||||
public function get allTime() : int
|
||||
{
|
||||
return (allDistance - 30) / getSpd() * (1000 / StageDriver.stage.frameRate);
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(action != null)
|
||||
{
|
||||
action.pause();
|
||||
}
|
||||
t.pause();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(action != null)
|
||||
{
|
||||
action.resume();
|
||||
}
|
||||
t.resume();
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
action.stop();
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
}
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
if(t != null)
|
||||
{
|
||||
stop();
|
||||
}
|
||||
removeAllEventListener();
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
}
|
||||
master = null;
|
||||
action = null;
|
||||
img.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package net.pixvi.myr.battle.view
|
||||
{
|
||||
public class DamageType
|
||||
{
|
||||
|
||||
public static const SKILL:int = 1;
|
||||
|
||||
public static const BASE_ATTACK:int = 2;
|
||||
|
||||
public static const THORNS:int = 3;
|
||||
|
||||
public static const GROUND:int = 4;
|
||||
|
||||
public static const DEAD_BOOM:int = 5;
|
||||
|
||||
public static const SUN_FIRE:int = 6;
|
||||
|
||||
public static const CHEAT:int = 7;
|
||||
|
||||
public static const BUFF_POI:int = 8;
|
||||
|
||||
public static const CONTROLLER_POI:int = 9;
|
||||
|
||||
public static const SELF_SKILL:int = 10;
|
||||
|
||||
public static const VIM:int = 11;
|
||||
|
||||
public static const CONTROLLER_CURE:int = 12;
|
||||
|
||||
public static const MOON_HEAL:int = 13;
|
||||
|
||||
public static const BUFF_CURE:int = 14;
|
||||
|
||||
public function DamageType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.view.mon.MonView;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BaseMonEffectMov implements IDispose
|
||||
{
|
||||
|
||||
public var typeId:String;
|
||||
|
||||
public var lastMov:BitMovieClip;
|
||||
|
||||
public function BaseMonEffectMov()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function startEffect(target:MonView) : void
|
||||
{
|
||||
var rotation:int = int(para.rotation);
|
||||
if(rotation == -1)
|
||||
{
|
||||
rotation = Random.integer(1,360);
|
||||
}
|
||||
try
|
||||
{
|
||||
lastMov = target.addMovByClass(para.mov,para.position,para.scaleX * (para.faceTo ? target.curFaceto() : 1),para.scaleY,para.fps,rotation,para.floatX * (para.faceTo ? target.curFaceto() : 1),para.floatY,null,null,para.top,para.loop);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
lastMov = target.addMovByClass(para.mov,para.position,para.scaleX * (para.faceTo ? target.curFaceto() : 1),para.scaleY,para.fps,rotation,para.floatX * (para.faceTo ? target.curFaceto() : 1),para.floatY,null,null,para.top);
|
||||
}
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.play();
|
||||
}
|
||||
}
|
||||
|
||||
public function dead() : void
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
if(lastMov != null)
|
||||
{
|
||||
lastMov.dispose();
|
||||
lastMov = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function get type() : String
|
||||
{
|
||||
return table().type;
|
||||
}
|
||||
|
||||
public function get movController() : String
|
||||
{
|
||||
return table().movController;
|
||||
}
|
||||
|
||||
public function get para() : Object
|
||||
{
|
||||
return table().para;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.monster_setting.effectMov[typeId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.view.mon.MonView;
|
||||
|
||||
public class MonEffectMovKeep extends BaseMonEffectMov
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonEffectMovKeep()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function startEffect(target:MonView) : void
|
||||
{
|
||||
if(cd == null)
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
super.startEffect(target);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
super.pause();
|
||||
if(cd != null)
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
super.resume();
|
||||
if(cd != null)
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package net.pixvi.myr.battle.view.effectmov
|
||||
{
|
||||
import net.pixvi.myr.center.Table;
|
||||
|
||||
public class MonEffectMovType
|
||||
{
|
||||
|
||||
public static const ATTACK_MOV:String = "attack";
|
||||
|
||||
public static const DEFENCE_MOV:String = "defence";
|
||||
|
||||
public static const NORMAL_MOV:String = "normal";
|
||||
|
||||
public function MonEffectMovType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getMonEffectMovByTypeId(typeId:String) : BaseMonEffectMov
|
||||
{
|
||||
var effect:BaseMonEffectMov = null;
|
||||
switch(Table.monster_setting.effectMov[typeId].movController.toString())
|
||||
{
|
||||
case "1":
|
||||
effect = new BaseMonEffectMov();
|
||||
break;
|
||||
case "2":
|
||||
effect = new MonEffectMovKeep();
|
||||
break;
|
||||
default:
|
||||
effect = new BaseMonEffectMov();
|
||||
}
|
||||
effect.typeId = typeId;
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package net.pixvi.myr.battle.view.piece
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.center.Game;
|
||||
import net.pixvi.pfw.ui.UIComponent;
|
||||
import net.pixvi.pfw.ui.controls.PiBitTextField;
|
||||
|
||||
public class BattleCostUI extends UIComponent
|
||||
{
|
||||
|
||||
public var text_cost:PiBitTextField;
|
||||
|
||||
public var t:TweenMax;
|
||||
|
||||
public function BattleCostUI(skin:DisplayObject = null, autoViewSize:Boolean = true, w:Number = 50, h:Number = 50)
|
||||
{
|
||||
skin = FF.getMC("mov.Cost");
|
||||
super(skin,autoViewSize,w,h);
|
||||
}
|
||||
|
||||
override public function onSkinComplete() : void
|
||||
{
|
||||
text_cost.mapMode = true;
|
||||
}
|
||||
|
||||
public function prepareShow() : void
|
||||
{
|
||||
this.alpha = 1;
|
||||
if(t != null)
|
||||
{
|
||||
t.kill();
|
||||
t = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function showHide() : void
|
||||
{
|
||||
if(Game.HQ)
|
||||
{
|
||||
t = TweenMax.to(this,0.5,{
|
||||
"alpha":0,
|
||||
"y":this.y - 30,
|
||||
"onComplete":costMovieFinishHandler
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
t = TweenMax.to(this,0.5,{
|
||||
"alpha":0,
|
||||
"y":this.y - 30,
|
||||
"onComplete":costMovieFinishHandler
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function costMovieFinishHandler() : void
|
||||
{
|
||||
t = null;
|
||||
if(this.parent != null)
|
||||
{
|
||||
this.parent.removeChild(this);
|
||||
this.alpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.user.ServerVo;
|
||||
import net.pixvi.myr.net.NetUser;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class AccountCenter
|
||||
{
|
||||
|
||||
public var username:String = "";
|
||||
|
||||
public var password:String = "";
|
||||
|
||||
public var userToken:String = "";
|
||||
|
||||
public var sdkUserId:String = "";
|
||||
|
||||
public var isVisitor:Boolean = false;
|
||||
|
||||
public var userServerList:Array;
|
||||
|
||||
public var userMasterList:Array;
|
||||
|
||||
public var curServer:ServerVo;
|
||||
|
||||
public var realName:String;
|
||||
|
||||
public var realID:String;
|
||||
|
||||
public var noticeData:Object = {};
|
||||
|
||||
private var onSdkLoginComplete:Function;
|
||||
|
||||
private var onLoginComplete:Function;
|
||||
|
||||
private var onSelectServerComplete:Function;
|
||||
|
||||
private var onSelectServerError:Function;
|
||||
|
||||
private var selectServer_serverId:int;
|
||||
|
||||
public function AccountCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : AccountCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(AccountCenter) as AccountCenter;
|
||||
}
|
||||
|
||||
public function sdkLogin(sdkUid:String, sdkToken:String, onComplete:Function) : void
|
||||
{
|
||||
onSdkLoginComplete = onComplete;
|
||||
NetUser.getIns().sdkLogin(sdkUid,sdkToken,sdkLoginHandler);
|
||||
}
|
||||
|
||||
private function sdkLoginHandler(re:Object) : void
|
||||
{
|
||||
userLoginCompleteHandler(re);
|
||||
if(onSdkLoginComplete != null)
|
||||
{
|
||||
onSdkLoginComplete(re);
|
||||
onSdkLoginComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function login(un:String, pw:String, onComplete:Function) : void
|
||||
{
|
||||
onLoginComplete = onComplete;
|
||||
NetUser.getIns().login(un,pw,loginHandler);
|
||||
}
|
||||
|
||||
private function loginHandler(re:Object) : void
|
||||
{
|
||||
if(re.re == 0 && re.resCode == 0)
|
||||
{
|
||||
userLoginCompleteHandler(re);
|
||||
}
|
||||
if(onLoginComplete != null)
|
||||
{
|
||||
onLoginComplete(re);
|
||||
onLoginComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function userLoginCompleteHandler(re:Object) : void
|
||||
{
|
||||
var maxvo:ServerVo = null;
|
||||
var i:int = 0;
|
||||
var sData:Object = null;
|
||||
var sVo:ServerVo = null;
|
||||
var j:int = 0;
|
||||
var mData:Object = null;
|
||||
var msVo:ServerVo = null;
|
||||
logout();
|
||||
if(re.re != 0 || re.resCode != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AccountCenter.getIns().userToken = re.playerInfo.token;
|
||||
userServerList = [];
|
||||
var serverDic:Object = {};
|
||||
for(i = 0; i < re.servers.length; )
|
||||
{
|
||||
sData = re.servers[i];
|
||||
if(sData.platform == MyrCenter.platform)
|
||||
{
|
||||
sVo = new ServerVo();
|
||||
sVo.channel = sData.channel;
|
||||
sVo.platform = sData.platform;
|
||||
sVo.gameServerAddress = sData.gameServerAddress;
|
||||
sVo.payServerAddress = sData.payServerAddress;
|
||||
sVo.serverName = sData.serverName;
|
||||
sVo.serverStatus = sData.serverStatus;
|
||||
sVo.serverId = sData.id;
|
||||
userServerList.push(sVo);
|
||||
serverDic[sVo.serverId] = sVo;
|
||||
if(maxvo == null || maxvo.serverId < sVo.serverId)
|
||||
{
|
||||
maxvo = sVo;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(maxvo != null)
|
||||
{
|
||||
maxvo.isNew = true;
|
||||
}
|
||||
for(j = 0; j < re.masterInfos.length; )
|
||||
{
|
||||
mData = re.masterInfos[j];
|
||||
msVo = serverDic[mData.serverId];
|
||||
if(msVo != null)
|
||||
{
|
||||
msVo.masterCreateTime = mData.createTime;
|
||||
msVo.masterId = mData.id;
|
||||
msVo.masterName = mData.masterName;
|
||||
msVo.masterUpdateTime = mData.updateTime;
|
||||
msVo.masterStatus = mData.status ? 1 : 0;
|
||||
msVo.hasMaster = true;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
AccountCenter.getIns().realID = re.playerInfo.userIdCard;
|
||||
AccountCenter.getIns().realName = re.playerInfo.userName;
|
||||
}
|
||||
|
||||
public function selectServer(serverId:int, onComplete:Function, onError:Function) : void
|
||||
{
|
||||
onSelectServerComplete = onComplete;
|
||||
onSelectServerError = onError;
|
||||
selectServer_serverId = serverId;
|
||||
NetUser.getIns().selectServer(serverId,selectServerHandler);
|
||||
}
|
||||
|
||||
public function selectServerHandler(re:Object) : void
|
||||
{
|
||||
if(re.resCode == 994 && GameMath.ModeTrace == false)
|
||||
{
|
||||
if(onSelectServerError != null)
|
||||
{
|
||||
onSelectServerError(lang("服务器爆满了!请稍后再来吧!"));
|
||||
}
|
||||
onSelectServerError = null;
|
||||
onSelectServerComplete = null;
|
||||
return;
|
||||
}
|
||||
if(re.resCode == 990)
|
||||
{
|
||||
if(onSelectServerError != null)
|
||||
{
|
||||
onSelectServerError(lang("服务器繁忙,请稍后再试吧!"));
|
||||
}
|
||||
onSelectServerError = null;
|
||||
onSelectServerComplete = null;
|
||||
return;
|
||||
}
|
||||
curServer = ArrayUtil.getElementByValue(userServerList,"serverId",selectServer_serverId) as ServerVo;
|
||||
if(MobiTools.isMobi() && MyrCenter.channel == "MEIZU" && Boolean(MyrAne.meizu2Bingxue))
|
||||
{
|
||||
MyrAne.bingxueSetRoleData(1,curServer.serverId,curServer.serverName,curServer.masterId.toString(),curServer.masterName,"1",100,"驯养师","","牧羊人之心");
|
||||
}
|
||||
if(onSelectServerComplete != null)
|
||||
{
|
||||
onSelectServerComplete();
|
||||
onSelectServerError = null;
|
||||
onSelectServerComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function logout() : void
|
||||
{
|
||||
MasterCenter.getIns().masterInfo = null;
|
||||
Game.getIns().master = null;
|
||||
}
|
||||
|
||||
public function userUpgrade(e:Event = null) : void
|
||||
{
|
||||
trace("更新账号类型");
|
||||
isVisitor = false;
|
||||
}
|
||||
|
||||
public function userUpgrade2(e:Event = null) : void
|
||||
{
|
||||
trace("更新账号类型2");
|
||||
isVisitor = false;
|
||||
}
|
||||
|
||||
public function get account() : Object
|
||||
{
|
||||
return Saver.getAuto("accountsave");
|
||||
}
|
||||
|
||||
public function resetAccount() : void
|
||||
{
|
||||
Saver.removeAuto("accountsave");
|
||||
}
|
||||
|
||||
public function loginOut() : void
|
||||
{
|
||||
MasterCenter.getIns().masterInfo = null;
|
||||
AccountCenter.getIns().userToken = "";
|
||||
}
|
||||
|
||||
public function saveAccount(username:String, password:String) : void
|
||||
{
|
||||
Saver.saveAuto("accountsave",{
|
||||
"username":username,
|
||||
"password":password
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.achi.AchiVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetAchi;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class AchiCenter extends Singleton
|
||||
{
|
||||
|
||||
private var finishAchi_achi:AchiVo;
|
||||
|
||||
private var onFinishAchiComplete:Function;
|
||||
|
||||
public function AchiCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : AchiCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(AchiCenter) as AchiCenter;
|
||||
}
|
||||
|
||||
public function autoCheck(type:String = "all", show:Boolean = false) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var a:String = null;
|
||||
var j:int = 0;
|
||||
var typeachis:Array = [];
|
||||
for(i = 0; i < Master.achis.length; )
|
||||
{
|
||||
a = Master.achis[i].type;
|
||||
if(type == "all" || Master.achis[i].type == type)
|
||||
{
|
||||
typeachis.push(Master.achis[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < typeachis.length; j++)
|
||||
{
|
||||
try
|
||||
{
|
||||
if((typeachis[j] as AchiVo).closed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(err:Error)
|
||||
{
|
||||
}
|
||||
if((show || !typeachis[j].showComplete) && typeachis[j].canFinish())
|
||||
{
|
||||
typeachis[j].showComplete = true;
|
||||
Alert.showMsg(CP.task(lang("获得成就") + "【" + typeachis[j].name + "】!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function finishAchi(achi:AchiVo, onComplete:Function = null) : void
|
||||
{
|
||||
onFinishAchiComplete = onComplete;
|
||||
finishAchi_achi = achi;
|
||||
NetAchi.getIns().finishAchi(achi.id.toString(),finishAchiHandler);
|
||||
}
|
||||
|
||||
private function finishAchiHandler(rewardResult:RewardResultVo) : void
|
||||
{
|
||||
finishAchi_achi.isComplete = true;
|
||||
RewardCenter.getIns().getReward(rewardResult,true,"panel");
|
||||
ArrayUtil.remove(Master.achis,finishAchi_achi);
|
||||
Master.achispass.push(finishAchi_achi);
|
||||
Master.history.passAchi.push(finishAchi_achi.id);
|
||||
for each(var i:int in finishAchi_achi.next)
|
||||
{
|
||||
if(Table.achi_info[i] != null)
|
||||
{
|
||||
unlockLocalAchi(i);
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ACHI_NUM_CHANGE));
|
||||
finishAchi_achi = null;
|
||||
if(onFinishAchiComplete != null)
|
||||
{
|
||||
onFinishAchiComplete();
|
||||
onFinishAchiComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function unlockLocalAchi(achiid:int) : void
|
||||
{
|
||||
var na:AchiVo = null;
|
||||
if(!checkAchiFinished(achiid))
|
||||
{
|
||||
na = new AchiVo();
|
||||
na.init(achiid);
|
||||
Master.achis.push(na);
|
||||
}
|
||||
}
|
||||
|
||||
public function getShowAchis() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var achis:Array = [];
|
||||
for(i = 0; i < Master.achis.length; )
|
||||
{
|
||||
if(GameMath.ModeTrace || !Master.achis[i].hide || Master.achis[i].canFinish())
|
||||
{
|
||||
if(!Master.achis[i].closed)
|
||||
{
|
||||
achis.push(Master.achis[i]);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
achis.sortOn("id");
|
||||
return achis;
|
||||
}
|
||||
|
||||
public function hasCompleteAchi() : Boolean
|
||||
{
|
||||
for each(var achivo:AchiVo in Master.achis)
|
||||
{
|
||||
if(!achivo.closed && !achivo.isComplete && achivo.canFinish())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkLocalAchiList() : void
|
||||
{
|
||||
var k:int = 0;
|
||||
var data:Object = null;
|
||||
var ua:AchiVo = null;
|
||||
var i:int = 0;
|
||||
var achiTypeId:int = 0;
|
||||
var achiData:AchiVo = null;
|
||||
var j:int = 0;
|
||||
var nextId:int = 0;
|
||||
var curAchiData:AchiVo = null;
|
||||
var curAchis:Array = [];
|
||||
var passAchis:Array = [];
|
||||
for(k = 0; k < Table.achi_infoArr.length; )
|
||||
{
|
||||
data = Table.achi_infoArr[k];
|
||||
if(data.unlock && Master.history.passAchi.indexOf(int(data.id)) == -1)
|
||||
{
|
||||
ua = new AchiVo();
|
||||
ua.id = data.id;
|
||||
curAchis.push(ua);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
for(i = 0; i < Master.history.passAchi.length; )
|
||||
{
|
||||
achiTypeId = int(Master.history.passAchi[i]);
|
||||
achiData = new AchiVo();
|
||||
achiData.isComplete = true;
|
||||
achiData.showComplete = true;
|
||||
achiData.id = achiTypeId;
|
||||
for(j = 0; j < achiData.next.length; )
|
||||
{
|
||||
nextId = int(achiData.next[j]);
|
||||
if(Table.achi_info[nextId] != null && Master.history.passAchi.indexOf(nextId) == -1)
|
||||
{
|
||||
curAchiData = new AchiVo();
|
||||
curAchiData.id = nextId;
|
||||
if(!curAchiData.closed)
|
||||
{
|
||||
curAchis.push(curAchiData);
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
passAchis.push(achiData);
|
||||
i++;
|
||||
}
|
||||
Master.achis = curAchis;
|
||||
Master.achispass = passAchis;
|
||||
}
|
||||
|
||||
public function checkAchiFinished(id:int) : Boolean
|
||||
{
|
||||
if(Master.history.passAchi.indexOf(id) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.myr.element.gacha.GachaVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.net.NetActi;
|
||||
import net.pixvi.myr.panel.dailycheck.DailyCheckPanel;
|
||||
import net.pixvi.myr.panel.event.EventClickImgPanel;
|
||||
import net.pixvi.myr.panel.event.EventImgPanel;
|
||||
import net.pixvi.myr.panel.event.dailygift.ActiDailyGiftPanel;
|
||||
import net.pixvi.myr.panel.gacha.GachaPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.moncol.MonColPanel;
|
||||
import net.pixvi.myr.panel.paypoint.PayPointPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class ActiCenter extends Singleton
|
||||
{
|
||||
|
||||
private var cacheDailyGet:Object;
|
||||
|
||||
private var onLoopCheckRewardComplete:Function;
|
||||
|
||||
private var onWeekTaskFinishComplete:Function;
|
||||
|
||||
private var onWeekTaskInfoComplete:Function;
|
||||
|
||||
private var onDailyGiftCheckComplete:Function;
|
||||
|
||||
private var updatingDailyGift:Boolean = false;
|
||||
|
||||
private var onVipDailyGiftCheckComplete:Function;
|
||||
|
||||
private var onDailyCheckCheckComplete:Function;
|
||||
|
||||
public function ActiCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : ActiCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ActiCenter) as ActiCenter;
|
||||
}
|
||||
|
||||
public function startEvent(data:Object = null) : void
|
||||
{
|
||||
var gachavo:GachaVo = null;
|
||||
var action:String = data.action;
|
||||
switch(action)
|
||||
{
|
||||
case "dailyGift":
|
||||
PopCenter.POP(new ActiDailyGiftPanel());
|
||||
break;
|
||||
case "payPoint":
|
||||
PopCenter.POP(new PayPointPanel());
|
||||
break;
|
||||
case "monCol":
|
||||
PopCenter.POP(new MonColPanel());
|
||||
break;
|
||||
case "contentImg":
|
||||
PopCenter.POP(new EventImgPanel(data));
|
||||
break;
|
||||
case "contentBigImg":
|
||||
PopCenter.POP(new EventClickImgPanel(data.data.contentImg));
|
||||
break;
|
||||
case "dailyCheck":
|
||||
PopCenter.POP(new DailyCheckPanel());
|
||||
break;
|
||||
case "gacha":
|
||||
gachavo = new GachaVo();
|
||||
GachaPanel.popInGacha(data.data.gachaId);
|
||||
}
|
||||
}
|
||||
|
||||
public function LoopCheckReward(onComplete:Function) : void
|
||||
{
|
||||
onLoopCheckRewardComplete = onComplete;
|
||||
NetActi.getIns().LoopCheckReward(LoopCheckRewardHandler);
|
||||
}
|
||||
|
||||
private function LoopCheckRewardHandler(re:Object) : void
|
||||
{
|
||||
Master.activityHistory.loopCheckRewardTime = re.param.dailyRewardGetTime / 1000;
|
||||
RewardCenter.getIns().getRewardByData(re.reward,true,"panel");
|
||||
if(onLoopCheckRewardComplete != null)
|
||||
{
|
||||
onLoopCheckRewardComplete(re);
|
||||
onLoopCheckRewardComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function weekTaskFinish(onComplete:Function) : void
|
||||
{
|
||||
onWeekTaskFinishComplete = onComplete;
|
||||
NetActi.getIns().weekTaskFinish(weekTaskFinishHandler);
|
||||
}
|
||||
|
||||
private function weekTaskFinishHandler(re:Object) : void
|
||||
{
|
||||
RewardCenter.getIns().getRewardByData(re.reward,true,"panel");
|
||||
Master.activityHistory.weekTaskStatus["getReward"] = true;
|
||||
if(onWeekTaskFinishComplete != null)
|
||||
{
|
||||
onWeekTaskFinishComplete(re);
|
||||
onWeekTaskFinishComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function weekTaskInfo(onComplete:Function) : void
|
||||
{
|
||||
onWeekTaskInfoComplete = onComplete;
|
||||
NetActi.getIns().weekTaskInfo(weekTaskInfoHandler);
|
||||
}
|
||||
|
||||
private function weekTaskInfoHandler(re:Object) : void
|
||||
{
|
||||
Master.activityHistory.weekTaskStatus = re.data;
|
||||
if(onWeekTaskInfoComplete != null)
|
||||
{
|
||||
onWeekTaskInfoComplete(re);
|
||||
onWeekTaskInfoComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkFinish(activityType:String) : Boolean
|
||||
{
|
||||
var checkDay:int = 0;
|
||||
var today:int = 0;
|
||||
var _loc4_:String = activityType;
|
||||
if("dailyCheck" !== _loc4_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
checkDay = Calendar.getDayNumber(Master.activityHistory.dailyCheckTime);
|
||||
today = Calendar.getDayNumber();
|
||||
if(Master.activityHistory.dailyCheckCount < 7 && checkDay != today)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function autoPopActivity() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var eventdata:Object = null;
|
||||
if(GuideCenter.getIns().checkFreshGuideFinish())
|
||||
{
|
||||
for(i = 0; i < Table.activity_info.events.length; )
|
||||
{
|
||||
eventdata = Table.activity_info.events[i];
|
||||
if(eventdata.autoPop == true && (eventdata.autoPopTimestamp == null || eventdata.autoPopTimestamp > TimeCenter.timestamp) && !checkFinish(eventdata.type))
|
||||
{
|
||||
startEvent(eventdata);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function dailyGiftChecked() : Boolean
|
||||
{
|
||||
var today:Date = MyrCalendar.getShowDate(ClockDriver.timestamp * 1000);
|
||||
var checkDay:Date = MyrCalendar.getShowDate(Master.activityHistory.dailyGiftCheckTime * 1000);
|
||||
if(today.fullYear == checkDay.fullYear && today.month == checkDay.month && today.date == checkDay.date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function dailyVipGiftChecked() : Boolean
|
||||
{
|
||||
return MasterCenter.getIns().getVipChecked();
|
||||
}
|
||||
|
||||
public function dailyGiftCheck(onComplete:Function = null) : void
|
||||
{
|
||||
onDailyGiftCheckComplete = onComplete;
|
||||
NetActi.getIns().dailyGiftCheck(dailyGiftCheckHandler);
|
||||
}
|
||||
|
||||
private function dailyGiftCheckHandler(rewardData:Object, newCount:int, newLevel:int) : void
|
||||
{
|
||||
Master.activityHistory.dailyGiftCheckTime = TimeCenter.timestamp;
|
||||
Master.activityHistory.dailyGiftCount = newCount;
|
||||
Master.activityHistory.dailyGiftLevel = newLevel;
|
||||
Master.activityHistory.dailyGiftSignCount++;
|
||||
MainMenu.getIns().ui.ui_top.update();
|
||||
RewardCenter.getIns().getRewardByData(rewardData,true,"panel");
|
||||
if(onDailyGiftCheckComplete != null)
|
||||
{
|
||||
onDailyGiftCheckComplete();
|
||||
onDailyGiftCheckComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function autoUpdateDailyGift() : void
|
||||
{
|
||||
if(updatingDailyGift)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function startUpdateDailyGift() : void
|
||||
{
|
||||
updatingDailyGift = true;
|
||||
NetActi.getIns().updateDailyGift(startUpdateDailyGiftHandler);
|
||||
}
|
||||
|
||||
private function startUpdateDailyGiftHandler(newLevel:int, newCount:int) : void
|
||||
{
|
||||
Master.activityHistory.dailyGiftCount = newCount;
|
||||
Master.activityHistory.dailyGiftLevel = newLevel;
|
||||
updatingDailyGift = false;
|
||||
}
|
||||
|
||||
public function vipDailyGiftCheck(onComplete:Function) : void
|
||||
{
|
||||
onVipDailyGiftCheckComplete = onComplete;
|
||||
NetActi.getIns().vipDailyGiftCheck(vipDailyGiftCheckHandler);
|
||||
}
|
||||
|
||||
private function vipDailyGiftCheckHandler(rewardData:Object) : void
|
||||
{
|
||||
var reward:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
RewardCenter.getIns().getReward(reward,true,"panel",null,false);
|
||||
Master.activityHistory.vipCheckTime = TimeCenter.timestamp * 1000;
|
||||
if(onVipDailyGiftCheckComplete != null)
|
||||
{
|
||||
onVipDailyGiftCheckComplete(reward);
|
||||
onVipDailyGiftCheckComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function dailyCheckCheck(onComplete:Function) : void
|
||||
{
|
||||
onDailyCheckCheckComplete = onComplete;
|
||||
NetActi.getIns().dailyCheckCheck(dailyCheckCheckHandler);
|
||||
}
|
||||
|
||||
private function dailyCheckCheckHandler(rewardData:Object) : void
|
||||
{
|
||||
var reward:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
RewardCenter.getIns().getReward(reward,true,"panel",null,false);
|
||||
Master.activityHistory.dailyCheckTime = TimeCenter.timestamp * 1000;
|
||||
Master.activityHistory.dailyCheckCount++;
|
||||
if(onDailyCheckCheckComplete != null)
|
||||
{
|
||||
onDailyCheckCheckComplete();
|
||||
onDailyCheckCheckComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.alchemy.AlchemyStackVo;
|
||||
import net.pixvi.myr.element.bag.BuildMaterialVo;
|
||||
import net.pixvi.myr.element.bag.EquipBuildVo;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.net.NetAlchemy;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class AlchemyCenter extends Singleton
|
||||
{
|
||||
|
||||
public static var alchemySpeedTime:int = 1800;
|
||||
|
||||
private var startAlchemy_para:Object;
|
||||
|
||||
private var onStartAlchemyComplete:Function;
|
||||
|
||||
private var onOverAlchemyComplete:Function;
|
||||
|
||||
private var overAlchemy_para:AlchemyStackVo;
|
||||
|
||||
private var onSpeedAlchemyComplete:Function;
|
||||
|
||||
private var speedAlchemy_para:Object;
|
||||
|
||||
private var onAddAlchemyStackComplete:Function;
|
||||
|
||||
public function AlchemyCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : AlchemyCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(AlchemyCenter) as AlchemyCenter;
|
||||
}
|
||||
|
||||
public static function getAlchemyStackByAlchemyStackData(alchemyStackData:Object) : AlchemyStackVo
|
||||
{
|
||||
var asvo:AlchemyStackVo = new AlchemyStackVo();
|
||||
asvo.id = alchemyStackData.id;
|
||||
asvo.starting = alchemyStackData.starting == 1;
|
||||
asvo.endTime = alchemyStackData.endTime / 1000;
|
||||
if(!asvo.starting || alchemyStackData.itemTypes == null || alchemyStackData.itemTypes == "")
|
||||
{
|
||||
asvo.itemTypes = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
asvo.itemTypes = Json.decode(alchemyStackData.itemTypes.toString()) as Array;
|
||||
}
|
||||
return asvo;
|
||||
}
|
||||
|
||||
public function startAlchemy(stackId:int, types:Array, items:Array, onComplete:Function) : void
|
||||
{
|
||||
onStartAlchemyComplete = onComplete;
|
||||
var materialDic:Object = {};
|
||||
var materialArr:Array = [];
|
||||
var level:int = getFormulaLevel(types);
|
||||
var cost:int = int(GameMath.alchemyFormulaCost[level].cost);
|
||||
for each(var item:ItemVo in items)
|
||||
{
|
||||
if(materialDic[item.id] == null)
|
||||
{
|
||||
materialDic[item.id] = {
|
||||
"itemId":item.id,
|
||||
"num":1
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
materialDic[item.id].num++;
|
||||
}
|
||||
}
|
||||
for each(var io:Object in materialDic)
|
||||
{
|
||||
materialArr.push(io);
|
||||
}
|
||||
startAlchemy_para = {
|
||||
"cost":cost,
|
||||
"items":materialArr,
|
||||
"types":types,
|
||||
"stackId":stackId
|
||||
};
|
||||
NetAlchemy.getIns().startAlchemy(stackId,materialArr,startAlchemyHandler);
|
||||
}
|
||||
|
||||
private function startAlchemyHandler(endTime:int, moneyCost:int) : void
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-moneyCost,true);
|
||||
for each(var item:Object in startAlchemy_para.items)
|
||||
{
|
||||
BagCenter.getIns().subNum(item.itemId,item.num);
|
||||
}
|
||||
var stackvo:AlchemyStackVo = getAlchemyStackVoById(startAlchemy_para.stackId);
|
||||
stackvo.itemTypes = startAlchemy_para.types;
|
||||
stackvo.starting = true;
|
||||
stackvo.endTime = endTime;
|
||||
if(onStartAlchemyComplete != null)
|
||||
{
|
||||
onStartAlchemyComplete();
|
||||
onStartAlchemyComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkAlchemyFormula(types:Array) : Boolean
|
||||
{
|
||||
var exp:EquipBuildVo = null;
|
||||
var ivo:ItemVo = null;
|
||||
var i:int = 0;
|
||||
var exps:Array = [];
|
||||
var items:Array = [];
|
||||
for each(i in types)
|
||||
{
|
||||
ivo = new ItemVo();
|
||||
ivo.num = 1;
|
||||
ivo.type = i;
|
||||
items.push(ivo);
|
||||
}
|
||||
var buildMaterialVo:BuildMaterialVo = new BuildMaterialVo();
|
||||
buildMaterialVo.buildByItemVoArr(items);
|
||||
for(i = 0; i < Table.equipbuild_list.length; )
|
||||
{
|
||||
exp = Table.equipbuild_list[i];
|
||||
if(exp.check(buildMaterialVo))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function overAlchemy(alchemyStackId:int, onComplete:Function) : void
|
||||
{
|
||||
onOverAlchemyComplete = onComplete;
|
||||
var alchemyStack:AlchemyStackVo = getAlchemyStackVoById(alchemyStackId);
|
||||
overAlchemy_para = alchemyStack;
|
||||
NetAlchemy.getIns().finishAlchemy(alchemyStack.id,overAlchemyComplete);
|
||||
}
|
||||
|
||||
public function overAlchemyComplete(equipData:Object) : void
|
||||
{
|
||||
var equipVo:EquipVo = BagCenter.getItemByItemData(equipData) as EquipVo;
|
||||
BagCenter.getIns().addItem(equipVo);
|
||||
overAlchemy_para.starting = false;
|
||||
overAlchemy_para.itemTypes = [];
|
||||
if(onOverAlchemyComplete != null)
|
||||
{
|
||||
onOverAlchemyComplete(equipVo);
|
||||
onOverAlchemyComplete = null;
|
||||
}
|
||||
overAlchemy_para = null;
|
||||
}
|
||||
|
||||
public function getDazaoMoneyCost(items:Array) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var material:Object = null;
|
||||
var j:int = 0;
|
||||
var materialNum:int = 0;
|
||||
for each(var it:ItemVo in items)
|
||||
{
|
||||
for(i = 0; i < it.material.length; )
|
||||
{
|
||||
material = it.material[i];
|
||||
materialNum += material.num;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for(j = 0; j < GameMath.alchemyFormulaLevel.length; )
|
||||
{
|
||||
if(GameMath.alchemyFormulaLevel[j].num > materialNum)
|
||||
{
|
||||
return GameMath.alchemyFormulaLevel[j].cost;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return materialNum;
|
||||
}
|
||||
|
||||
public function getFormulaLevel(itemTypes:Array) : int
|
||||
{
|
||||
var k:int = 0;
|
||||
var type:int = 0;
|
||||
var i:int = 0;
|
||||
var material:Object = null;
|
||||
var j:int = 0;
|
||||
var materialNum:int = 0;
|
||||
for(k = 0; k < itemTypes.length; )
|
||||
{
|
||||
type = int(itemTypes[k]);
|
||||
for(i = 0; i < Table.item_info[type].material.length; )
|
||||
{
|
||||
material = Table.item_info[type].material[i];
|
||||
materialNum += int(material.value);
|
||||
i++;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
var lv:int = 1;
|
||||
for(j = 0; j < GameMath.alchemyFormulaLevel.length; )
|
||||
{
|
||||
if(materialNum <= GameMath.alchemyFormulaLevel[j].num)
|
||||
{
|
||||
return GameMath.alchemyFormulaLevel[j].lv;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return lv;
|
||||
}
|
||||
|
||||
public function getAlchemyStackVoById(id:int) : AlchemyStackVo
|
||||
{
|
||||
for each(var vo:AlchemyStackVo in Master.alchemyStacks)
|
||||
{
|
||||
if(vo.id == id)
|
||||
{
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function speedAlchemyByItem(alchemyStackId:int, itemNum:int, onComplete:Function) : void
|
||||
{
|
||||
onSpeedAlchemyComplete = onComplete;
|
||||
var item:ItemVo = BagCenter.getIns().getByType(GameMath.alchemySpeedItemId);
|
||||
speedAlchemy_para = {
|
||||
"num":itemNum,
|
||||
"id":alchemyStackId,
|
||||
"itemId":item.id
|
||||
};
|
||||
NetAlchemy.getIns().speedAlchemy(alchemyStackId,itemNum,item.id,speedAlchemyHandler);
|
||||
}
|
||||
|
||||
private function speedAlchemyHandler(newEndTime:int) : void
|
||||
{
|
||||
BagCenter.getIns().subNum(speedAlchemy_para.itemId,speedAlchemy_para.num,true);
|
||||
getAlchemyStackVoById(speedAlchemy_para.id).endTime = newEndTime;
|
||||
if(onSpeedAlchemyComplete != null)
|
||||
{
|
||||
onSpeedAlchemyComplete();
|
||||
onSpeedAlchemyComplete = null;
|
||||
speedAlchemy_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function addAlchemeyStack(onComplete:Function) : void
|
||||
{
|
||||
onAddAlchemyStackComplete = onComplete;
|
||||
NetAlchemy.getIns().addAlchemyStack(allAlchemyStackComplete);
|
||||
}
|
||||
|
||||
public function allAlchemyStackComplete(alchemyStackData:Object = null) : void
|
||||
{
|
||||
var num:int = int(Master.alchemyStacks.length);
|
||||
var money:int = int(Table.alchemyStack_price[num.toString()].money);
|
||||
var ke:int = int(Table.alchemyStack_price[num.toString()].ke);
|
||||
if(money != 0)
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-money);
|
||||
}
|
||||
if(ke != 0)
|
||||
{
|
||||
MasterCenter.getIns().addKe(-ke);
|
||||
}
|
||||
var s:AlchemyStackVo = getAlchemyStackByAlchemyStackData(alchemyStackData);
|
||||
Master.alchemyStacks.push(s);
|
||||
if(onAddAlchemyStackComplete != null)
|
||||
{
|
||||
onAddAlchemyStackComplete();
|
||||
onAddAlchemyStackComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function hasFinish() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var s:AlchemyStackVo = null;
|
||||
for(i = 0; i < Master.alchemyStacks.length; )
|
||||
{
|
||||
s = Master.alchemyStacks[i];
|
||||
if(s.starting && s.finish())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,609 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetItem;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class BagCenter
|
||||
{
|
||||
|
||||
public var nearstUseMethod:int = 0;
|
||||
|
||||
public var nearstGetMethod:int = 0;
|
||||
|
||||
private var sell_para:Object;
|
||||
|
||||
private var useItem_para:Object;
|
||||
|
||||
private var onUseItemComplete:Function;
|
||||
|
||||
private var onGiftCodeComplete:Function;
|
||||
|
||||
public function BagCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getName(type:int) : String
|
||||
{
|
||||
return Table.item_info[type].name;
|
||||
}
|
||||
|
||||
public static function getIns() : BagCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BagCenter) as BagCenter;
|
||||
}
|
||||
|
||||
public static function eggSpeedItemNum() : int
|
||||
{
|
||||
return getIns().getNum(GameMath.speedItemId);
|
||||
}
|
||||
|
||||
public static function alchemySpeedItemNum() : int
|
||||
{
|
||||
return getIns().getNum(GameMath.alchemySpeedItemId);
|
||||
}
|
||||
|
||||
public static function getItemByItemData(itemData:Object) : ItemVo
|
||||
{
|
||||
var item:ItemVo = null;
|
||||
var eq:EquipVo = null;
|
||||
switch(ItemVo.getItemType(itemData.typeId))
|
||||
{
|
||||
case ItemType.TYPE_EGG:
|
||||
item = new EggVo();
|
||||
break;
|
||||
case ItemType.TYPE_EQUIP:
|
||||
item = new EquipVo();
|
||||
eq = item as EquipVo;
|
||||
eq.isUsed = itemData.isUsed > 0;
|
||||
if(itemData.equipParams == null || itemData.itemClass != 3)
|
||||
{
|
||||
itemData.equipPara = {
|
||||
"apCostSave":0,
|
||||
"atk":0,
|
||||
"atkPoi":0,
|
||||
"atkPoiDmg":0,
|
||||
"atkSpd":0,
|
||||
"atkStun":0,
|
||||
"atkVim":0,
|
||||
"crit":0,
|
||||
"deadBoom":0,
|
||||
"def":0,
|
||||
"defStun":0,
|
||||
"dex":0,
|
||||
"hp":0,
|
||||
"moonHeal":0,
|
||||
"selfCure":0,
|
||||
"skillCooldown":0,
|
||||
"sunFire":0,
|
||||
"thorns":0
|
||||
};
|
||||
Alert.showMsg(Paster.font("equip error:" + itemData.id + ",pls contact customer service to fix。",null,14,true));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemData.equipPara = Json.decode(itemData.equipParams);
|
||||
}
|
||||
eq.atk.val = itemData.equipPara.atk;
|
||||
eq.def.val = itemData.equipPara.def;
|
||||
eq.hp.val = itemData.equipPara.hp;
|
||||
eq.dex.val = itemData.equipPara.dex;
|
||||
eq.crit.val = itemData.equipPara.crit;
|
||||
eq.atkSpd.val = itemData.equipPara.atkSpd;
|
||||
eq.atkVim.val = itemData.equipPara.atkVim;
|
||||
eq.selfCure.val = itemData.equipPara.selfCure;
|
||||
eq.deadBoom.val = itemData.equipPara.deadBoom;
|
||||
eq.atkStun.val = itemData.equipPara.atkStun;
|
||||
eq.atkStunTime.val = 2;
|
||||
eq.atkStunType = Table.item_info[itemData.typeId].atkStunType;
|
||||
eq.defStun.val = itemData.equipPara.defStun;
|
||||
eq.defStunTime.val = 2;
|
||||
eq.defStunType = Table.item_info[itemData.typeId].defStunType;
|
||||
eq.atkPoi.val = itemData.equipPara.atkPoi;
|
||||
eq.atkPoiDmg.val = itemData.equipPara.atkPoiDmg;
|
||||
eq.atkPoiType = itemData.equipPara.atkPoiType;
|
||||
eq.apCostSave.val = itemData.equipPara.apCostSave;
|
||||
eq.skillCooldown.val = itemData.equipPara.skillCooldown;
|
||||
eq.sunFire.val = itemData.equipPara.sunFire;
|
||||
eq.moonHeal.val = itemData.equipPara.moonHeal;
|
||||
eq.thorns.val = itemData.equipPara.thorns;
|
||||
break;
|
||||
default:
|
||||
item = new ItemVo();
|
||||
}
|
||||
item.id = itemData.id;
|
||||
item.type = itemData.typeId;
|
||||
item.num = itemData.num;
|
||||
return item;
|
||||
}
|
||||
|
||||
public function subNum(itemId:Number, num:int, show:Boolean = false, keyword:String = "") : ItemVo
|
||||
{
|
||||
var str:String = null;
|
||||
if(keyword == null || keyword == "")
|
||||
{
|
||||
keyword = lang("消耗了 {0} 个 {1}");
|
||||
}
|
||||
var itemvo:ItemVo = getById(itemId);
|
||||
itemvo.num -= num;
|
||||
if(show)
|
||||
{
|
||||
str = lang(keyword,CP.item(num.toString()),CP.item(itemvo.name));
|
||||
Alert.showMsg(str);
|
||||
}
|
||||
if(itemvo.num == 0)
|
||||
{
|
||||
removeItem(itemId);
|
||||
}
|
||||
else if(itemvo.num < 0)
|
||||
{
|
||||
throw new Error("err less than zero");
|
||||
}
|
||||
return itemvo;
|
||||
}
|
||||
|
||||
public function subNumByType(itemTypeId:int, num:int, show:Boolean = false, keyword:String = "", sendEvent:Boolean = false) : ItemVo
|
||||
{
|
||||
var vo:ItemVo = subNum(getByType(itemTypeId).id,num,show,keyword);
|
||||
if(sendEvent && vo != null)
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,vo));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
public function removeItem(itemid:Number) : void
|
||||
{
|
||||
ArrayUtil.removeByValue(Master.bag.items,"id",itemid);
|
||||
}
|
||||
|
||||
public function checkNeed(needs:Array, money:int = 0, ke:int = 0) : Boolean
|
||||
{
|
||||
if(Master.money < money || Master.ke < ke)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for each(var o:Object in needs)
|
||||
{
|
||||
if(getNum(o.type) < o.num)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function subLocalCost(cost:CostVo, show:Boolean = false, num:int = 1, sendEvent:Boolean = false) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var itemdata:Object = null;
|
||||
if(cost.ke > 0)
|
||||
{
|
||||
MasterCenter.getIns().addKe(-cost.ke * num,show);
|
||||
}
|
||||
if(cost.money > 0)
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-cost.money * num,show);
|
||||
}
|
||||
if(cost.ti > 0)
|
||||
{
|
||||
MasterCenter.getIns().addTi(-cost.ti * num,show);
|
||||
}
|
||||
if(cost.items.length > 0)
|
||||
{
|
||||
for(i = 0; i < cost.items.length; )
|
||||
{
|
||||
itemdata = cost.items[i];
|
||||
subNumByType(itemdata.typeId,itemdata.num * num,show,"",sendEvent);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function checkCost(cost:CostVo, exceptEquipOn:Boolean = false, exceptTiKeMoney:Boolean = false) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var needi:Object = null;
|
||||
var hasnum:int = 0;
|
||||
if(!exceptTiKeMoney && (Master.ke < cost.ke || Master.money < cost.money || Master.ti < cost.ti))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i = 0;
|
||||
while(i < cost.items.length)
|
||||
{
|
||||
needi = cost.items[i];
|
||||
hasnum = BagCenter.getIns().getNum(needi.typeId,exceptEquipOn);
|
||||
if(hasnum < needi.num)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function addItem(itemvo:ItemVo) : void
|
||||
{
|
||||
var newItemVo:EggVo = null;
|
||||
var oldvo:ItemVo = getById(itemvo.id);
|
||||
if(oldvo == null)
|
||||
{
|
||||
if(itemvo.itemType == ItemType.TYPE_EGG)
|
||||
{
|
||||
newItemVo = new EggVo();
|
||||
newItemVo.id = itemvo.id;
|
||||
newItemVo.num = itemvo.num;
|
||||
newItemVo.type = itemvo.type;
|
||||
itemvo = newItemVo;
|
||||
}
|
||||
Master.bag.items.push(itemvo);
|
||||
if(itemvo.itemType == ItemType.TYPE_EQUIP)
|
||||
{
|
||||
if(Master.history.equipLib.indexOf(itemvo.type.toString()) == -1)
|
||||
{
|
||||
Master.history.equipLib.push(itemvo.type.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oldvo.num += itemvo.num;
|
||||
}
|
||||
TaskCenter.getIns().activityItemNum(itemvo.type);
|
||||
}
|
||||
|
||||
public function addItems(arr:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
addItem(arr[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function isSingleItem(type:int) : Boolean
|
||||
{
|
||||
return Table.item_info[type].maxNum == 1;
|
||||
}
|
||||
|
||||
public function isEquipItem(type:int) : Boolean
|
||||
{
|
||||
return Table.item_info[type].itemType == ItemType.TYPE_EQUIP;
|
||||
}
|
||||
|
||||
public function getNum(type:int, exceptEquipOn:Boolean = false) : int
|
||||
{
|
||||
var j:int = 0;
|
||||
var eq:EquipVo = null;
|
||||
var i:int = 0;
|
||||
var num:int = 0;
|
||||
var arr:Array = getAllItemvo(type);
|
||||
if(arr.length > 0 && exceptEquipOn && arr[0] is EquipVo)
|
||||
{
|
||||
for(j = 0; j < arr.length; )
|
||||
{
|
||||
eq = arr[j] as EquipVo;
|
||||
if(!eq.isUsed)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
i = 0;
|
||||
while(i < arr.length)
|
||||
{
|
||||
num += arr[i].num;
|
||||
i++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function getAllItemvo(type:int) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var a:Array = [];
|
||||
var len:int = int(Master.bag.items.length);
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if((Master.bag.items[i] as ItemVo).type == type)
|
||||
{
|
||||
a.push(Master.bag.items[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public function getIdsByType(type:int, num:int) : Array
|
||||
{
|
||||
var ids:Array = [];
|
||||
var hasNum:int = 0;
|
||||
var items:Array = getAllItemvo(type);
|
||||
for each(var item:ItemVo in items)
|
||||
{
|
||||
if(hasNum >= num)
|
||||
{
|
||||
break;
|
||||
}
|
||||
ids.push(item.id);
|
||||
hasNum += item.num;
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
public function getById(id:Number) : ItemVo
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < Master.bag.items.length; )
|
||||
{
|
||||
if(Master.bag.items[i].id == id)
|
||||
{
|
||||
return Master.bag.items[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getByType(type:int) : ItemVo
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < Master.bag.items.length; )
|
||||
{
|
||||
if(Master.bag.items[i].type == type)
|
||||
{
|
||||
return Master.bag.items[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function sell(itemId:Number, num:int = 1, show:Boolean = false) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:MonsterVo = null;
|
||||
var sellitem:ItemVo = getById(itemId);
|
||||
if(num < 0 || num > 10000)
|
||||
{
|
||||
Alert.showMsg("error number.");
|
||||
return;
|
||||
}
|
||||
if(sellitem.itemType == ItemType.TYPE_EQUIP)
|
||||
{
|
||||
if((sellitem as EquipVo).isUsed)
|
||||
{
|
||||
Alert.showMsg(lang("装备【{0}】正在使用中。").replace("{0}",sellitem.name));
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
while(i < Master.monsters.length)
|
||||
{
|
||||
mon = Master.monsters[i];
|
||||
if(mon.equip1 == sellitem.id || mon.equip2 == sellitem.id || mon.equip3 == sellitem.id || mon.equip4 == sellitem.id || mon.equip5 == sellitem.id)
|
||||
{
|
||||
Alert.yes("sell item error","equip status:" + sellitem["isUsed"] + ",conflict:m" + mon.id + ",pls contact customer service。");
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
sell_para = {
|
||||
"itemId":itemId,
|
||||
"num":num,
|
||||
"show":show
|
||||
};
|
||||
NetItem.getIns().sellItem(itemId,num,sellHandler);
|
||||
}
|
||||
|
||||
private function sellHandler(money:int) : void
|
||||
{
|
||||
var item:ItemVo = getById(sell_para.itemId);
|
||||
item.num -= sell_para.num;
|
||||
if(item.num == 0)
|
||||
{
|
||||
Master.bag.removeItem(sell_para.itemId);
|
||||
}
|
||||
MasterCenter.getIns().addMoney(money,sell_para.show);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,item));
|
||||
sell_para = null;
|
||||
}
|
||||
|
||||
public function subLocalNeed(arr:Array, show:Boolean = false) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var o:Object = null;
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
o = arr[i];
|
||||
subNumByType(o.type,o.num,show);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function useItem(id:Number, num:int, onComplete:Function) : void
|
||||
{
|
||||
onUseItemComplete = onComplete;
|
||||
useItem_para = {
|
||||
"id":id,
|
||||
"num":num
|
||||
};
|
||||
var item:ItemVo = getById(id);
|
||||
NetItem.getIns().useItem(id,num,useItemHandler);
|
||||
}
|
||||
|
||||
private function useItemHandler(rewardData:Object, param:Object) : void
|
||||
{
|
||||
var vipstr:String = null;
|
||||
var item:ItemVo = subNum(useItem_para.id,useItem_para.num);
|
||||
switch(item.para.action)
|
||||
{
|
||||
case "vipCard":
|
||||
Master.vipTime = param.vipTime;
|
||||
vipstr = lang("获得了{0}天的【特别驯养师】资格!剩余天数:{1}",item.para.day * useItem_para.num,MasterCenter.getIns().getVipDay());
|
||||
Alert.yes(lang("恭喜!"),vipstr);
|
||||
if(!GuideCenter.getIns().checkFin(GSub.ACHI_VIP))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.ACHI_VIP);
|
||||
AchiCenter.getIns().autoCheck(AchiType.NONE,true);
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
MyrAne.track("monthlycard");
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.VIP_STATUS_CHANGE));
|
||||
break;
|
||||
case "getAvatar":
|
||||
if(Master.avatars != null)
|
||||
{
|
||||
Master.avatars.push(item.para.avatarType);
|
||||
}
|
||||
if(Master.newAvatars == null)
|
||||
{
|
||||
Master.newAvatars = [];
|
||||
}
|
||||
Master.newAvatars.push(item.para.avatarType);
|
||||
Alert.showMsg(lang("解锁了新头像") + "【" + Table.avatar_info[item.para.avatarType].des + "】");
|
||||
break;
|
||||
case "getSkin":
|
||||
Master.history.unlockSkins.push(int(item.para.skinType));
|
||||
Alert.showMsg(lang("解锁了魔物时装") + "【" + Table.skin_info[item.para.skinType].name + "】");
|
||||
break;
|
||||
default:
|
||||
RewardCenter.getIns().getRewardByData(rewardData,true,"panel");
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,item));
|
||||
useItem_para = null;
|
||||
if(onUseItemComplete != null)
|
||||
{
|
||||
onUseItemComplete();
|
||||
onUseItemComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function resetItemUsingNum() : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var len:int = int(Master.bag.items.length);
|
||||
for(j = 0; j < len; )
|
||||
{
|
||||
Master.bag.items[j].usingNum = 0;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
public function giftCode(giftCode:String, onComplete:Function) : void
|
||||
{
|
||||
onGiftCodeComplete = onComplete;
|
||||
NetItem.getIns().giftCode(giftCode,giftCodeHandler);
|
||||
}
|
||||
|
||||
private function giftCodeHandler(rewardData:Object, resCode:int, resMsg:String) : void
|
||||
{
|
||||
if(resCode != 0)
|
||||
{
|
||||
Alert.yes("giftcode失效",resMsg);
|
||||
return;
|
||||
}
|
||||
RewardCenter.getIns().getRewardByData(rewardData,true,"panel",null);
|
||||
if(onGiftCodeComplete != null)
|
||||
{
|
||||
onGiftCodeComplete();
|
||||
onGiftCodeComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function equipTypeByTypes(valueName:String, type:String, typeIds:Array) : int
|
||||
{
|
||||
var equip:EquipVo = null;
|
||||
var i:int = 0;
|
||||
var num:int = 0;
|
||||
for(i = 0; i < typeIds.length; )
|
||||
{
|
||||
equip = new EquipVo();
|
||||
equip.type = typeIds[i];
|
||||
equip.buildAuto();
|
||||
if(equip != null)
|
||||
{
|
||||
if(equip[valueName] != null && equip[valueName].val > 0)
|
||||
{
|
||||
return equip[type];
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function getAllSkinItem() : Array
|
||||
{
|
||||
var itemIds:Array = [];
|
||||
if(Table.item_info == null || Master.history == null || Master.history.unlockSkins == null)
|
||||
{
|
||||
return itemIds;
|
||||
}
|
||||
for each(var itemData:Object in Table.item_info)
|
||||
{
|
||||
if(!(itemData == null || itemData.para == null || itemData.para.action != "getSkin"))
|
||||
{
|
||||
if(Master.history.unlockSkins.indexOf(int(itemData.para.skinType)) != -1)
|
||||
{
|
||||
itemIds.push(itemData.type.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
itemIds.sort(sortBySkinLevel);
|
||||
return itemIds;
|
||||
}
|
||||
|
||||
private function sortBySkinLevel(a:Object, b:Object) : int
|
||||
{
|
||||
var la:int = getSkinLevelByItem(int(a));
|
||||
var lb:int = getSkinLevelByItem(int(b));
|
||||
if(la != lb)
|
||||
{
|
||||
return lb - la;
|
||||
}
|
||||
return int(a) - int(b);
|
||||
}
|
||||
|
||||
private function getSkinLevelByItem(type:int) : int
|
||||
{
|
||||
var item:Object = Table.item_info[type];
|
||||
if(item == null || item.para == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var skin:Object = Table.skin_info[item.para.skinType.toString()];
|
||||
if(skin == null || skin.level == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return int(skin.level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.bag.EquipVo;
|
||||
import net.pixvi.myr.element.battle.BattleMonVo;
|
||||
import net.pixvi.myr.element.battle.BattlePosition;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.battle.BattleVo;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.pve.PveAreaInfoVo;
|
||||
import net.pixvi.myr.element.pve.PveCharaDataVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class BattleCenter extends Singleton
|
||||
{
|
||||
|
||||
public function BattleCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : BattleCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BattleCenter) as BattleCenter;
|
||||
}
|
||||
|
||||
public function startBattle(battlePosition:BattlePosition, battleObj:Object, rewardObj:Object, onComplete:Function, onBattleOver:Function = null) : void
|
||||
{
|
||||
SoundCenter.getIns().bgmStop();
|
||||
var battle:BattleVo = new BattleVo();
|
||||
battle.buildByObject(battleObj);
|
||||
battle.teams[0].team = 2;
|
||||
var reward:RewardVo = new RewardVo();
|
||||
reward.setByObject(rewardObj);
|
||||
battle.reward = reward;
|
||||
var myteam:BattleTeamVo = TeamCenter.getIns().getBattleTeamVo(Master.curBattleTeam);
|
||||
if(battle.hideTeamMon)
|
||||
{
|
||||
myteam.mons = [];
|
||||
}
|
||||
myteam.team = 1;
|
||||
battle.teams.push(myteam);
|
||||
battle.teamDic["1"] = myteam;
|
||||
var p:BattlePanel = BattlePanel.getIns();
|
||||
p.battlePosition = battlePosition;
|
||||
p.onComplete = onComplete;
|
||||
p.onBattleShowResult = onBattleOver;
|
||||
p.battle = battle;
|
||||
p.startBuild();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
public function startPveBattle(area:PveAreaInfoVo, enemyPveData:PveCharaDataVo, onComplete:Function, onBattleOver:Function = null) : void
|
||||
{
|
||||
SoundCenter.getIns().bgmStop();
|
||||
var battleData:Object = Random.element(Table.pve_info.areaBattle[area.pveAreaType]);
|
||||
battleData.teams = [];
|
||||
battleData.teams.push(PveCenter.getIns().getPveBattleTeamVo(area,enemyPveData));
|
||||
var battle:BattleVo = new BattleVo();
|
||||
battle.battleMode = BattleModeType.PVE;
|
||||
battle.buildByObject(battleData);
|
||||
var myteam:BattleTeamVo = TeamCenter.getIns().getBattleTeamVo(area.pveAreaType);
|
||||
myteam.numMax = area.getNumMax(myteam.numMax);
|
||||
if(battle.hideTeamMon)
|
||||
{
|
||||
myteam.mons = [];
|
||||
}
|
||||
myteam.team = 1;
|
||||
battle.teams.push(myteam);
|
||||
battle.teamDic["1"] = myteam;
|
||||
battle.initPve();
|
||||
var p:BattlePanel = BattlePanel.getIns();
|
||||
p.onComplete = onComplete;
|
||||
p.onBattleShowResult = onBattleOver;
|
||||
p.battle = battle;
|
||||
p.battleMode = BattleModeType.PVE;
|
||||
p.startBuild();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
public function startBossBattle(bossvo:BossVo, onComplete:Function, onBattleOver:Function = null) : void
|
||||
{
|
||||
SoundCenter.getIns().bgmStop();
|
||||
var battle:BattleVo = new BattleVo();
|
||||
battle.buildByObject(bossvo.getCurBattle());
|
||||
battle.teams[0].team = 2;
|
||||
battle.battleMode = BattleModeType.BOSS;
|
||||
var reward:RewardVo = new RewardVo();
|
||||
battle.reward = reward;
|
||||
var myteam:BattleTeamVo = TeamCenter.getIns().getBattleTeamVo(Master.curBattleTeam);
|
||||
if(battle.hideTeamMon)
|
||||
{
|
||||
myteam.mons = [];
|
||||
}
|
||||
myteam.team = 1;
|
||||
battle.teams.push(myteam);
|
||||
battle.teamDic["1"] = myteam;
|
||||
var p:BattlePanel = BattlePanel.getIns();
|
||||
p.onComplete = onComplete;
|
||||
p.onBattleShowResult = onBattleOver;
|
||||
p.battle = battle;
|
||||
p.battleMode = BattleModeType.BOSS;
|
||||
p.startBuild();
|
||||
PopCenter.POP(p);
|
||||
}
|
||||
|
||||
public function makeBattleMon(type:int, level:int, team:int = 2, mode:int = 2, oscale:Number = 0, name:String = "", equips:Array = null, skills:Array = null, skillsLv:Array = null) : BattleMon
|
||||
{
|
||||
if(equips == null)
|
||||
{
|
||||
equips = [];
|
||||
}
|
||||
if(Table.monster_info[type.toString()] == null)
|
||||
{
|
||||
Alert.yes("error","查找不到的魔物类型[" + type + "]");
|
||||
return null;
|
||||
}
|
||||
var m:MonsterVo = new MonsterVo(type);
|
||||
m.buildByArea();
|
||||
m.level = level;
|
||||
m.mode = mode;
|
||||
if(name != "")
|
||||
{
|
||||
m.nicName = name;
|
||||
}
|
||||
var b:BattleMonVo = new BattleMonVo();
|
||||
b.buildByMonster(m);
|
||||
b.team = team;
|
||||
b.equips = equips;
|
||||
if(skills != null && skills[0] != null)
|
||||
{
|
||||
b.skill_1 = int(skills[0]);
|
||||
}
|
||||
if(skills != null && skills[1] != null)
|
||||
{
|
||||
b.skill_2 = int(skills[1]);
|
||||
}
|
||||
if(skillsLv != null && skillsLv[0] != null)
|
||||
{
|
||||
b.skill_1_lv = int(skillsLv[0]);
|
||||
}
|
||||
if(skillsLv != null && skillsLv[0] != null)
|
||||
{
|
||||
b.skill_2_lv = int(skillsLv[0]);
|
||||
}
|
||||
var mon:BattleMon = new BattleMon();
|
||||
if(oscale != 0)
|
||||
{
|
||||
mon.oscale = oscale;
|
||||
}
|
||||
mon.init(b);
|
||||
mon.buildView();
|
||||
mon.teamVo = BattlePanel.getIns().ground.vo.teamDic[team];
|
||||
return mon;
|
||||
}
|
||||
|
||||
public function getBattleMonVoDataByNetUserMonData(mondata:Object, teamPos:int) : Object
|
||||
{
|
||||
var j:int = 0;
|
||||
var pveMonData:Object = mondata;
|
||||
var equipTypes:Array = [];
|
||||
for(j = 1; j <= 5; )
|
||||
{
|
||||
if(pveMonData["equip" + j + "TypeId"] > 0)
|
||||
{
|
||||
equipTypes.push(pveMonData["equip" + j + "TypeId"]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
var monstervo:MonsterVo = new MonsterVo(pveMonData.typeId);
|
||||
monstervo.level = pveMonData.monLevel;
|
||||
monstervo.tplevel = pveMonData.monTpLevel;
|
||||
if(pveMonData.monUpStar != null)
|
||||
{
|
||||
monstervo.upStar = pveMonData.monUpStar;
|
||||
}
|
||||
monstervo.buildSkill();
|
||||
if(pveMonData.skin != null)
|
||||
{
|
||||
monstervo.skin = pveMonData.skin;
|
||||
}
|
||||
var battleMonVo:Object = {
|
||||
"setOScale":0,
|
||||
"nicname":pveMonData.nicName,
|
||||
"level":monstervo.level,
|
||||
"type":monstervo.skinShowType,
|
||||
"mode":2,
|
||||
"teamPos":teamPos,
|
||||
"atk_dis":Table.monster_info[pveMonData.typeId].atk_dis,
|
||||
"spd_mov":Table.monster_info[pveMonData.typeId].spd_move + GameMath.addMovSpdByDex(pveMonData.dex),
|
||||
"spd_atk":Table.monster_info[pveMonData.typeId].spd_atk + GameMath.addAtkSpdByDex(pveMonData.dex),
|
||||
"autoValue":false,
|
||||
"ai":MonsterCenter.getIns().getAiByAiType(pveMonData.aiType),
|
||||
"ai_search":MonsterCenter.getIns().getAiSearchByAiType(pveMonData.aiType),
|
||||
"mid":pveMonData.monsterId,
|
||||
"skill_1":monstervo.skill_1,
|
||||
"skill_1_lv":monstervo.skill_1_lv,
|
||||
"skill_2":monstervo.skill_2,
|
||||
"skill_2_lv":monstervo.skill_2_lv,
|
||||
"ornaments":equipTypes,
|
||||
"apRecovery":true
|
||||
};
|
||||
battleMonVo.teamPos = TeamCenter.getIns().teamPos2battleTeamPos[battleMonVo.teamPos];
|
||||
for each(var equipPara:String in EquipVo.EQUIP_PARAS)
|
||||
{
|
||||
battleMonVo[equipPara] = pveMonData[equipPara];
|
||||
}
|
||||
battleMonVo.defStunType = BagCenter.getIns().equipTypeByTypes("defStun","defStunType",equipTypes);
|
||||
battleMonVo.atkStunType = BagCenter.getIns().equipTypeByTypes("atkStun","atkStunType",equipTypes);
|
||||
return battleMonVo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.boss.BossVo;
|
||||
import net.pixvi.myr.element.master.HistoryVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetBoss;
|
||||
import net.pixvi.myr.panel.boss.BossStagePanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.wild.WildPanel;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class BossCenter
|
||||
{
|
||||
|
||||
public var bossData:Array = [];
|
||||
|
||||
private var onGetBossListComplete:Function;
|
||||
|
||||
private var onStartBossComplete:Function;
|
||||
|
||||
private var startBoss_bossId:String;
|
||||
|
||||
private var onEndBossComplete:Function;
|
||||
|
||||
private var getBossReward_bossId:String;
|
||||
|
||||
private var getBossReward_time:Number;
|
||||
|
||||
private var onGetBossRewardComplete:Function;
|
||||
|
||||
private var updateBossHp_bossid:String;
|
||||
|
||||
private var onupdateBossHpComplete:Function;
|
||||
|
||||
public function BossCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : BossCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(BossCenter) as BossCenter;
|
||||
}
|
||||
|
||||
public function getBossByBossId(bossId:String) : BossVo
|
||||
{
|
||||
for each(var bvo:BossVo in bossData)
|
||||
{
|
||||
if(bvo.bossId == bossId)
|
||||
{
|
||||
return bvo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function firstGetBossList() : void
|
||||
{
|
||||
getBossList(null,false);
|
||||
}
|
||||
|
||||
public function getBossList(onComplete:Function = null, wait:Boolean = true) : void
|
||||
{
|
||||
onGetBossListComplete = onComplete;
|
||||
if(HistoryVo.voVersion == 2)
|
||||
{
|
||||
if(onGetBossListComplete != null)
|
||||
{
|
||||
onGetBossListComplete();
|
||||
onGetBossListComplete = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
NetBoss.getIns().getBossList(getBossListHandler,wait);
|
||||
}
|
||||
|
||||
private function getBossListHandler(re:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var bvo:BossVo = null;
|
||||
var j:int = 0;
|
||||
var ubo:BossVo = null;
|
||||
var bossesData:Array = re.bossInfo;
|
||||
var userData:Array = re.bossHuntInfos;
|
||||
bossData = [];
|
||||
for(i = 0; i < bossesData.length; )
|
||||
{
|
||||
bvo = new BossVo();
|
||||
bvo.setData(bossesData[i]);
|
||||
bossData.push(bvo);
|
||||
bvo.prevLocalCheckTime = TimeCenter.timestamp;
|
||||
i++;
|
||||
}
|
||||
if(userData != null)
|
||||
{
|
||||
for(j = 0; j < userData.length; )
|
||||
{
|
||||
ubo = getBossByBossId(userData[j].bossId);
|
||||
if(ubo != null)
|
||||
{
|
||||
ubo.setHuntInfo(userData[j]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.BOSS_LIST_UPDATE));
|
||||
if(onGetBossListComplete != null)
|
||||
{
|
||||
onGetBossListComplete();
|
||||
onGetBossListComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function autoCheckBossTip() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var bossvo:BossVo = null;
|
||||
MainMenu.getIns().ui.ui_top.ui_notice.resetAllMsg("boss");
|
||||
for(i = 0; i < bossData.length; )
|
||||
{
|
||||
bossvo = bossData[i];
|
||||
MainMenu.getIns().ui.ui_top.ui_notice.insert(bossvo.notice);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function startBoss(bossId:String, onComplete:Function) : void
|
||||
{
|
||||
startBoss_bossId = bossId;
|
||||
onStartBossComplete = onComplete;
|
||||
NetBoss.getIns().startBoss(bossId,startBossHandler);
|
||||
}
|
||||
|
||||
private function startBossHandler(re:Object) : void
|
||||
{
|
||||
var bossvo:BossVo = getBossByBossId(startBoss_bossId);
|
||||
bossvo.currentHp = re.bossInfo.currentHp;
|
||||
bossvo.damage = re.bossHuntInfo.damage;
|
||||
bossvo.huntNumCount = re.bossHuntInfo.huntNumCount;
|
||||
bossvo.huntTime = re.bossHuntInfo.huntTime / 1000;
|
||||
BagCenter.getIns().subLocalCost(bossvo.battleCost);
|
||||
if(onStartBossComplete != null)
|
||||
{
|
||||
onStartBossComplete();
|
||||
onStartBossComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function endBoss(bossId:String, damage:int, battleData:BattleData, onComplete:Function) : void
|
||||
{
|
||||
onEndBossComplete = onComplete;
|
||||
BossStagePanel.userHit = damage;
|
||||
NetBoss.getIns().endBoss(bossId,damage,battleData,endBossHandler);
|
||||
}
|
||||
|
||||
private function endBossHandler(re:Object) : void
|
||||
{
|
||||
var reward:RewardResultVo = RewardCenter.getRewardResultVoByData(re.reward);
|
||||
var boss:BossVo = getBossByBossId(startBoss_bossId);
|
||||
boss.damage = re.param.damage;
|
||||
boss.damageCount = re.param.totalDamage;
|
||||
boss.huntNumCount = re.param.totalHuntNum;
|
||||
boss.currentHp = re.param.currentBossHp;
|
||||
if(onEndBossComplete != null)
|
||||
{
|
||||
onEndBossComplete(reward);
|
||||
onEndBossComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getBossReward(bossId:String, onComplete:Function) : void
|
||||
{
|
||||
onGetBossRewardComplete = onComplete;
|
||||
getBossReward_bossId = bossId;
|
||||
getBossReward_time = TimeCenter.timestamp;
|
||||
NetBoss.getIns().getBossReward(bossId,getBossRewardHandler);
|
||||
}
|
||||
|
||||
private function getBossRewardHandler(re:Object) : void
|
||||
{
|
||||
var reward:RewardResultVo = RewardCenter.getRewardResultVoByData(re.reward);
|
||||
var boss:BossVo = getBossByBossId(getBossReward_bossId);
|
||||
boss.getRewardTime = getBossReward_time;
|
||||
boss.getReward = true;
|
||||
RewardCenter.getIns().getReward(reward,true,"panel",onGetBossRewardComplete);
|
||||
onGetBossRewardComplete = null;
|
||||
}
|
||||
|
||||
public function updateBossHp(bossId:String, onComplete:Function) : void
|
||||
{
|
||||
onupdateBossHpComplete = onComplete;
|
||||
updateBossHp_bossid = bossId;
|
||||
NetBoss.getIns().updateBossHp(bossId,updateBossHpHandler);
|
||||
}
|
||||
|
||||
private function updateBossHpHandler(hp:Number) : void
|
||||
{
|
||||
var bossVo:BossVo = getBossByBossId(updateBossHp_bossid);
|
||||
if(bossVo != null)
|
||||
{
|
||||
bossVo.currentHp = hp;
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.BOSS_HP_UPDATE,bossVo));
|
||||
if(onupdateBossHpComplete != null)
|
||||
{
|
||||
onupdateBossHpComplete(hp);
|
||||
onupdateBossHpComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function dayPass() : void
|
||||
{
|
||||
Caller.delayCall(getBossList,100 + Random.integer(1,800),1,[dayPassHandler]);
|
||||
}
|
||||
|
||||
public function dayPassHandler(e:Event = null) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function secondCheck() : void
|
||||
{
|
||||
var bossvo:BossVo = null;
|
||||
var i:int = 0;
|
||||
if(bossData == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
while(i < bossData.length)
|
||||
{
|
||||
bossvo = bossData[i];
|
||||
if(!bossvo.preNoticed && bossvo.needPreNotice())
|
||||
{
|
||||
bossvo.preNoticed = true;
|
||||
MainMenu.getIns().ui.ui_top.ui_notice.insert(bossvo.preNotice,2,"boss" + bossvo.bossId);
|
||||
}
|
||||
else if(!bossvo.noticed && bossvo.needNotice())
|
||||
{
|
||||
bossvo.noticed = true;
|
||||
bossvo.status = 1;
|
||||
MainMenu.getIns().ui.ui_top.ui_notice.insert(bossvo.notice,99999,"boss" + bossvo.bossId);
|
||||
if(WildPanel.getIns().showing)
|
||||
{
|
||||
WildPanel.getIns().stageMap.updateBoss();
|
||||
}
|
||||
}
|
||||
else if(bossvo.noticed && bossvo.status == 1 && bossvo.isOver())
|
||||
{
|
||||
bossvo.status = 2;
|
||||
MainMenu.getIns().ui.ui_top.ui_notice.resetAllMsg("boss" + bossvo.bossId);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.battle.view.BattleMonBuff;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class BuffCenter extends Singleton
|
||||
{
|
||||
|
||||
public function BuffCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function makeIns() : BuffCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(Singleton);
|
||||
}
|
||||
|
||||
public static function getStunMovByType(buff:BattleMonBuff, stunType:int, time:int) : void
|
||||
{
|
||||
switch(stunType - 1)
|
||||
{
|
||||
case 0:
|
||||
buff.addBuffMov("mov.BuffStun","stun",time * 1000,1,24,1,0,0,true);
|
||||
break;
|
||||
case 1:
|
||||
SoundCenter.getIns().play(GameSound.effect_skill_icehit);
|
||||
buff.addBuffMov("mov.BuffIce","ice",time * 1000,1.4,20,0,0,0,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPoiMovByType(buff:BattleMonBuff, atkStunType:int, atkStunTime:int) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.city.CityVo;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class CityCenter
|
||||
{
|
||||
|
||||
public var citys:Object;
|
||||
|
||||
public function CityCenter()
|
||||
{
|
||||
super();
|
||||
citys = {};
|
||||
}
|
||||
|
||||
public static function getIns() : CityCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(CityCenter) as CityCenter;
|
||||
}
|
||||
|
||||
public function getCity(id:int) : CityVo
|
||||
{
|
||||
if(citys[id] == null)
|
||||
{
|
||||
if(Table.city_info[id] == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
citys[id] = new CityVo(id);
|
||||
}
|
||||
return citys[id];
|
||||
}
|
||||
|
||||
public function get curCity() : CityVo
|
||||
{
|
||||
var city:CityVo = getCity(Master.curCityId);
|
||||
if(city == null)
|
||||
{
|
||||
return getCity(1);
|
||||
}
|
||||
return city;
|
||||
}
|
||||
|
||||
public function unlockCity(cid:String) : void
|
||||
{
|
||||
Master.history.unlockCity[cid] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.task.TaskStatusType;
|
||||
import net.pixvi.myr.element.task.TaskType;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class DiaryCenter extends Singleton
|
||||
{
|
||||
|
||||
public function DiaryCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : DiaryCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(DiaryCenter) as DiaryCenter;
|
||||
}
|
||||
|
||||
public function autoCheckPassStory() : void
|
||||
{
|
||||
var taskData:Object = null;
|
||||
var i:int = 0;
|
||||
var stepData:Object = null;
|
||||
var j:int = 0;
|
||||
var stepData2:Object = null;
|
||||
for(var taskid:String in Master.history.passTask)
|
||||
{
|
||||
taskData = Table.task_info[taskid];
|
||||
if(taskData == null)
|
||||
{
|
||||
Alert.showMsg("can\'t find task:" + taskid);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(taskData.startStep.npc != "" && taskData.startStep.story != "")
|
||||
{
|
||||
Master.history.passStory[taskData.startStep.story] = true;
|
||||
}
|
||||
for(i = 0; i < taskData.steps.length; )
|
||||
{
|
||||
stepData = taskData.steps[i];
|
||||
Master.history.passStory[stepData.story] = true;
|
||||
Master.history.passStory[stepData.afterStory] = true;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved)
|
||||
{
|
||||
if(t.table().startStep.npc != "" && t.table().startStep.story != "")
|
||||
{
|
||||
Master.history.passStory[taskData.startStep.story] = true;
|
||||
}
|
||||
for(j = 0; j < t.steps.length; )
|
||||
{
|
||||
if(j < t.step)
|
||||
{
|
||||
stepData2 = t.steps[j];
|
||||
Master.history.passStory[stepData2.story] = true;
|
||||
Master.history.passStory[stepData2.afterStory] = true;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for each(var bindStory:Object in Table.diary_info.storyBindTask)
|
||||
{
|
||||
if(Master.history.passTask[bindStory.task])
|
||||
{
|
||||
Master.history.passStory[bindStory.story] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getTaskAllStory(taskTypeId:String) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var stepData:Object = null;
|
||||
var para:Object = null;
|
||||
var monTypeId:String = null;
|
||||
var mon:MonsterVo = null;
|
||||
var j:int = 0;
|
||||
var arr:Array = [];
|
||||
var id:int = 1;
|
||||
var taskData:Object = Table.task_info[taskTypeId];
|
||||
if(taskData.startStep.story != "")
|
||||
{
|
||||
Master.history.passStory[taskData.startStep.story] = true;
|
||||
arr.push({
|
||||
"story":taskData.startStep.story,
|
||||
"para":{}
|
||||
});
|
||||
id++;
|
||||
}
|
||||
for(i = 0; i < taskData.steps.length; )
|
||||
{
|
||||
stepData = taskData.steps[i];
|
||||
para = {};
|
||||
if(stepData.statusType == TaskStatusType.GET_ITEM)
|
||||
{
|
||||
para.itemNum = stepData.statusValue.num;
|
||||
para.itemName = ItemVo.getName(stepData.statusValue.type);
|
||||
}
|
||||
if(stepData.story != "")
|
||||
{
|
||||
Master.history.passStory[stepData.story] = true;
|
||||
arr.push({
|
||||
"story":stepData.story,
|
||||
"para":para
|
||||
});
|
||||
id++;
|
||||
}
|
||||
if(stepData.afterStory != "")
|
||||
{
|
||||
Master.history.passStory[stepData.afterStory] = true;
|
||||
arr.push({
|
||||
"story":stepData.afterStory,
|
||||
"para":para
|
||||
});
|
||||
id++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(taskData.type == TaskType.ENTANGLE_TASK)
|
||||
{
|
||||
monTypeId = taskTypeId.substr(1,7);
|
||||
if(Table.setting.entangleTaskToMonTypeFix[taskTypeId] != null)
|
||||
{
|
||||
monTypeId = Table.setting.entangleTaskToMonTypeFix[taskTypeId];
|
||||
}
|
||||
mon = MonsterCenter.getIns().getEntangleMonByType(int(monTypeId));
|
||||
for(j = 0; j < arr.length; )
|
||||
{
|
||||
arr[j].para.monName = mon.name;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getDiaryCg() : Array
|
||||
{
|
||||
return Table.diary_info.cgs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.display.Sprite;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.AppLayer;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.gamelib.utils.GameClickMovie;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class DisplayCenter
|
||||
{
|
||||
|
||||
public var clickMovie:GameClickMovie;
|
||||
|
||||
public var connectingMovie:BitMovieClip;
|
||||
|
||||
public var connectingMovieShow:Boolean = false;
|
||||
|
||||
public var shadowMask:Sprite;
|
||||
|
||||
public function DisplayCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : DisplayCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(DisplayCenter) as DisplayCenter;
|
||||
}
|
||||
|
||||
public function startUp() : void
|
||||
{
|
||||
clickMovie = new GameClickMovie(FF.getFC("ui.ClickMov"),60);
|
||||
AppLayer.app.LAYER_MOUSE.addChild(clickMovie);
|
||||
connectingMovie = FF.getBMC("mov.ConnectingMovie");
|
||||
connectingMovie.stop();
|
||||
connectingMovie.scaleX = connectingMovie.scaleY = 0.9;
|
||||
StageLocator.setPosition(connectingMovie);
|
||||
shadowMask = PopCenter.getIns().createMaskWithNormalSet();
|
||||
shadowMask.alpha = 0;
|
||||
}
|
||||
|
||||
public function showConnecting(delay:int = 1000) : void
|
||||
{
|
||||
if(connectingMovieShow)
|
||||
{
|
||||
return;
|
||||
}
|
||||
connectingMovieShow = true;
|
||||
AppLayer.app.LAYER_AD.addChild(shadowMask);
|
||||
if(delay > 0)
|
||||
{
|
||||
Caller.delayCall(connectingShowing,delay);
|
||||
}
|
||||
else
|
||||
{
|
||||
connectingShowing();
|
||||
}
|
||||
}
|
||||
|
||||
private function connectingShowing() : void
|
||||
{
|
||||
trace("showing connectingmovie");
|
||||
if(connectingMovieShow)
|
||||
{
|
||||
AppLayer.app.LAYER_AD.addChild(connectingMovie);
|
||||
connectingMovie.play();
|
||||
connectingMovie.mouseChildren = connectingMovie.mouseEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function connectingComplete() : void
|
||||
{
|
||||
connectingMovieShow = false;
|
||||
if(connectingMovie.parent != null)
|
||||
{
|
||||
connectingMovie.parent.removeChild(connectingMovie);
|
||||
}
|
||||
if(shadowMask.parent != null)
|
||||
{
|
||||
shadowMask.parent.removeChild(shadowMask);
|
||||
}
|
||||
connectingMovie.stop();
|
||||
Caller.stopCall(connectingComplete);
|
||||
trace("hide connectingmovie");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.AppLayer;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Director;
|
||||
|
||||
public class EffectCenter
|
||||
{
|
||||
|
||||
public function EffectCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function open_effect(x:int, y:int, fps:int = 40, scaleX:Number = 1.5, scaleY:Number = 1.5) : void
|
||||
{
|
||||
var bmc:BitMovieClip = FF.getBMC("mov.SkillStartLevel3",40);
|
||||
bmc.x = x;
|
||||
bmc.y = y;
|
||||
bmc.scaleX = scaleX;
|
||||
bmc.scaleY = scaleY;
|
||||
AppLayer.app.LAYER_FRONT.addChild(bmc);
|
||||
Director.playOnce(bmc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetEntangle;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class EntangleCenter
|
||||
{
|
||||
|
||||
private var onMakeEntangleComplete:Function;
|
||||
|
||||
private var makeEntangle_mon:MonsterVo;
|
||||
|
||||
private var makeEntangle_item:ItemVo;
|
||||
|
||||
private var onEntangleLevelUpComplete:Function;
|
||||
|
||||
private var entangleLevelUp_mon:MonsterVo;
|
||||
|
||||
private var onSetEntangleSkillComplete:Function;
|
||||
|
||||
private var entangleSkill_para:Object;
|
||||
|
||||
private var onResetEntangleSkillComplete:Function;
|
||||
|
||||
private var resetEntangleSkill_mon:MonsterVo;
|
||||
|
||||
public function EntangleCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : EntangleCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(EntangleCenter) as EntangleCenter;
|
||||
}
|
||||
|
||||
public function makeEntangle(mid:Number, onComplete:Function) : void
|
||||
{
|
||||
onMakeEntangleComplete = onComplete;
|
||||
makeEntangle_mon = MonsterCenter.getIns().getMonById(mid);
|
||||
makeEntangle_item = BagCenter.getIns().getByType(Table.entangle_info.entangleItem);
|
||||
NetEntangle.getIns().makeEntangle(mid,makeEntangle_item.id,makeEntangleHandler);
|
||||
}
|
||||
|
||||
private function makeEntangleHandler(unlockTask:String) : void
|
||||
{
|
||||
TaskCenter.getIns().unlockLocalTask(unlockTask);
|
||||
makeEntangle_mon.entangle = true;
|
||||
BagCenter.getIns().subNumByType(Table.entangle_info.entangleItem,1,true);
|
||||
GlobalBroadcast.dispatchEvent(new PiEvent(MYREvent.MONSTER_INFO_CHANGE,{"mon":makeEntangle_mon}));
|
||||
makeEntangle_mon = null;
|
||||
makeEntangle_item = null;
|
||||
AchiCenter.getIns().autoCheck(AchiType.ENTANGLE);
|
||||
if(onMakeEntangleComplete != null)
|
||||
{
|
||||
onMakeEntangleComplete();
|
||||
onMakeEntangleComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function entangleLevelUp(mid:Number, onComplete:Function) : void
|
||||
{
|
||||
onEntangleLevelUpComplete = onComplete;
|
||||
entangleLevelUp_mon = MonsterCenter.getIns().getMonById(mid);
|
||||
NetEntangle.getIns().entangleLevelUp(mid,entangleLevelUpHandler);
|
||||
}
|
||||
|
||||
private function entangleLevelUpHandler(unlockTask:String, newLevel:int) : void
|
||||
{
|
||||
TaskCenter.getIns().unlockLocalTask(unlockTask);
|
||||
entangleLevelUp_mon.entangleLevel = newLevel;
|
||||
entangleLevelUp_mon = null;
|
||||
if(onEntangleLevelUpComplete != null)
|
||||
{
|
||||
onEntangleLevelUpComplete();
|
||||
onEntangleLevelUpComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function setEntangleSkill(monId:Number, skillType:String, level:int, onComplete:Function) : void
|
||||
{
|
||||
onSetEntangleSkillComplete = onComplete;
|
||||
entangleSkill_para = {
|
||||
"monId":monId,
|
||||
"skillType":skillType,
|
||||
"level":level
|
||||
};
|
||||
NetEntangle.getIns().setEntangleSkill(monId,level,skillType,setEntangleSkillHandler);
|
||||
}
|
||||
|
||||
private function setEntangleSkillHandler(globalAdd:Object, monAdd:Object) : void
|
||||
{
|
||||
var mon:MonsterVo = MonsterCenter.getIns().getMonById(entangleSkill_para.monId);
|
||||
mon.entangleSkill[entangleSkill_para.level] = entangleSkill_para.skillType;
|
||||
Master.globalAdd.update(globalAdd);
|
||||
mon.abilityAdd.update(monAdd);
|
||||
if(onSetEntangleSkillComplete != null)
|
||||
{
|
||||
onSetEntangleSkillComplete();
|
||||
onSetEntangleSkillComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function resetEntangleSkill(monId:Number, onComplete:Function) : void
|
||||
{
|
||||
onResetEntangleSkillComplete = onComplete;
|
||||
resetEntangleSkill_mon = MonsterCenter.getIns().getMonById(monId);
|
||||
var itemvo:ItemVo = BagCenter.getIns().getByType(Table.entangle_info.resetEntangleSkillItem);
|
||||
NetEntangle.getIns().resetEntangleSkill(monId,itemvo.id,resetEntangleSkillHandler);
|
||||
}
|
||||
|
||||
private function resetEntangleSkillHandler(globalAdd:Object, monAdd:Object) : void
|
||||
{
|
||||
resetEntangleSkill_mon.entangleSkill = {};
|
||||
BagCenter.getIns().subNumByType(Table.entangle_info.resetEntangleSkillItem,1,true);
|
||||
Master.globalAdd.update(globalAdd);
|
||||
resetEntangleSkill_mon.abilityAdd.update(monAdd);
|
||||
if(onResetEntangleSkillComplete != null)
|
||||
{
|
||||
onResetEntangleSkillComplete();
|
||||
onResetEntangleSkillComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.myr.element.explore.ExploreAreaVo;
|
||||
import net.pixvi.myr.element.explore.ExploreTeamVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetExplore;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class ExploreCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onCancelExploreComplete:Function;
|
||||
|
||||
private var cancelExplore_teamId:int;
|
||||
|
||||
private var onAddTeamComplete:Function;
|
||||
|
||||
private var addTeam_para:Object;
|
||||
|
||||
private var onStartExploreComplete:Function;
|
||||
|
||||
private var onFinishExploreComplete:Function;
|
||||
|
||||
private var finishExplore_teamID:int;
|
||||
|
||||
public function ExploreCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : ExploreCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ExploreCenter) as ExploreCenter;
|
||||
}
|
||||
|
||||
public static function makeTeamByData(data:Object) : ExploreTeamVo
|
||||
{
|
||||
var team:ExploreTeamVo = new ExploreTeamVo();
|
||||
team.area = data.area;
|
||||
team.id = data.id;
|
||||
if(data.rewardResult != null && data.rewardResult != "")
|
||||
{
|
||||
team.endTime = data.endTime / 1000;
|
||||
team.monsters = ArrayUtil.split(data.monsters,",");
|
||||
team.randoms = ArrayUtil.split(data.random,",",true);
|
||||
team.reward = RewardCenter.getRewardResultVoByData(Json.decode(data.rewardResult));
|
||||
team.startTime;
|
||||
}
|
||||
team.status = data.status;
|
||||
return team;
|
||||
}
|
||||
|
||||
public function hasFinishExplore() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var team:ExploreTeamVo = null;
|
||||
for(i = 0; i < Master.exploreTeams.length; )
|
||||
{
|
||||
team = Master.exploreTeams[i];
|
||||
if(team.status == 1 && team.endTime < TimeCenter.timestamp)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getExploreAreas() : Array
|
||||
{
|
||||
var area:ExploreAreaVo = null;
|
||||
var arr:Array = [];
|
||||
for each(var o:Object in Table.explore_info)
|
||||
{
|
||||
if(o.mine == null)
|
||||
{
|
||||
area = new ExploreAreaVo();
|
||||
area.area = o.id;
|
||||
if(area.unlock)
|
||||
{
|
||||
arr.push(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
arr.sortOn("area");
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getMineAreas(mine:String = "mine1") : Array
|
||||
{
|
||||
var area:ExploreAreaVo = null;
|
||||
var arr:Array = [];
|
||||
for each(var o:Object in Table.explore_info)
|
||||
{
|
||||
if(o.mine != null)
|
||||
{
|
||||
area = new ExploreAreaVo();
|
||||
area.area = o.id;
|
||||
if(area.unlock)
|
||||
{
|
||||
arr.push(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
arr.sortOn("area");
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getAreaByTeam(team:String = "normal") : Array
|
||||
{
|
||||
var area:ExploreAreaVo = null;
|
||||
var arr:Array = [];
|
||||
for each(var o:Object in Table.explore_info)
|
||||
{
|
||||
if(o.team == team)
|
||||
{
|
||||
area = new ExploreAreaVo();
|
||||
area.area = o.id;
|
||||
if(area.unlock)
|
||||
{
|
||||
arr.push(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
arr.sortOn("area",16);
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function checkStage(stage:String) : ExploreAreaVo
|
||||
{
|
||||
var area:ExploreAreaVo = null;
|
||||
for each(var o:Object in Table.explore_info)
|
||||
{
|
||||
area = new ExploreAreaVo();
|
||||
area.area = o.id;
|
||||
if(area.passStage() == stage)
|
||||
{
|
||||
return area;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function cancelExplore(teamId:int, onComplete:Function) : void
|
||||
{
|
||||
onCancelExploreComplete = onComplete;
|
||||
cancelExplore_teamId = teamId;
|
||||
NetExplore.getIns().cancelExplore(teamId,cancelExploreHandler);
|
||||
}
|
||||
|
||||
private function cancelExploreHandler(re:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:MonsterVo = null;
|
||||
var team:ExploreTeamVo = ExploreCenter.getIns().getTeamById(cancelExplore_teamId);
|
||||
team.status = 0;
|
||||
for(i = 0; i < team.monsters.length; )
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(team.monsters[i]);
|
||||
mon.inExploreTeam = false;
|
||||
i++;
|
||||
}
|
||||
if(onCancelExploreComplete != null)
|
||||
{
|
||||
onCancelExploreComplete();
|
||||
onCancelExploreComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function addTeam(onComplete:Function) : void
|
||||
{
|
||||
onAddTeamComplete = onComplete;
|
||||
addTeam_para = {};
|
||||
if(ExploreCenter.getIns().nextTable.money > 0)
|
||||
{
|
||||
addTeam_para.costNum = ExploreCenter.getIns().nextTable.money;
|
||||
addTeam_para.type = "money";
|
||||
}
|
||||
else
|
||||
{
|
||||
addTeam_para.costNum = ExploreCenter.getIns().nextTable.ke;
|
||||
addTeam_para.type = "ke";
|
||||
}
|
||||
NetExplore.getIns().addTeam(addTeamHandler);
|
||||
}
|
||||
|
||||
private function addTeamHandler(teamdata:Object) : void
|
||||
{
|
||||
var team:ExploreTeamVo = makeTeamByData(teamdata);
|
||||
Master.exploreTeams.push(team);
|
||||
if(addTeam_para.type == "money")
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-addTeam_para.costNum,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MasterCenter.getIns().addKe(-addTeam_para.costNum,true);
|
||||
}
|
||||
addTeam_para = null;
|
||||
if(onAddTeamComplete != null)
|
||||
{
|
||||
onAddTeamComplete();
|
||||
onAddTeamComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function startExplore(teamID:int, monsters:Array, area:String, onComplete:Function) : void
|
||||
{
|
||||
onStartExploreComplete = onComplete;
|
||||
NetExplore.getIns().startExplore(teamID,monsters,area,startExploreHandler);
|
||||
}
|
||||
|
||||
private function startExploreHandler(teamData:Object, newTime:Number) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var monstervo:MonsterVo = null;
|
||||
ClockDriver.getIns().timestamp = newTime;
|
||||
var team:ExploreTeamVo = getTeamById(teamData.id);
|
||||
team.endTime = teamData.endTime / 1000;
|
||||
team.reward = RewardCenter.getRewardResultVoByData(Json.decode(teamData.rewardResult));
|
||||
team.monsters = ArrayUtil.split(teamData.monsters,",",true);
|
||||
team.randoms = ArrayUtil.split(teamData.random,",",true);
|
||||
team.status = teamData.status;
|
||||
team.area = teamData.area;
|
||||
var area:ExploreAreaVo = new ExploreAreaVo();
|
||||
area.area = team.area;
|
||||
MasterCenter.getIns().addTi(-area.costTi);
|
||||
for(i = 0; i < team.monsters.length; )
|
||||
{
|
||||
monstervo = MonsterCenter.getIns().getMonById(team.monsters[i]);
|
||||
monstervo.inExploreTeam = true;
|
||||
i++;
|
||||
}
|
||||
if(onStartExploreComplete != null)
|
||||
{
|
||||
onStartExploreComplete();
|
||||
onStartExploreComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function finishExplore(teamID:int, onComplete:Function) : void
|
||||
{
|
||||
onFinishExploreComplete = onComplete;
|
||||
finishExplore_teamID = teamID;
|
||||
NetExplore.getIns().finishExplore(teamID,finishExploreHandler);
|
||||
}
|
||||
|
||||
private function finishExploreHandler(rewardData:Object, monExp:Array, unlockStage:Array) : void
|
||||
{
|
||||
var mon:MonsterVo = null;
|
||||
var reward:RewardResultVo = RewardCenter.getIns().getRewardByData(rewardData);
|
||||
for each(var o:Object in monExp)
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(o.monId);
|
||||
mon.exp += o.exp;
|
||||
if(mon.level != o.level)
|
||||
{
|
||||
mon.level = o.level;
|
||||
o.levelUp = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
o.levelUp = false;
|
||||
}
|
||||
mon.inExploreTeam = false;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_NUM_CHANGE,{"mon":mon}));
|
||||
}
|
||||
if(unlockStage.length > 0)
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.EXPLORE_STAGE_UPDATE));
|
||||
}
|
||||
StageCenter.getIns().unlockLocalStages(unlockStage,true);
|
||||
var teamvo:ExploreTeamVo = getTeamById(finishExplore_teamID);
|
||||
teamvo.status = 0;
|
||||
onFinishExploreComplete(reward,monExp);
|
||||
}
|
||||
|
||||
public function getTeamById(teamId:int) : ExploreTeamVo
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < Master.exploreTeams.length; )
|
||||
{
|
||||
if(Master.exploreTeams[i].id == teamId)
|
||||
{
|
||||
return Master.exploreTeams[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function get nextTable() : Object
|
||||
{
|
||||
return Table.game_setting.exploreTeamLevel[Master.exploreTeams.length];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.gacha.GachaVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.net.NetGacha;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class GachaCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onGachaComplete:Function;
|
||||
|
||||
private var gacha_para:Object;
|
||||
|
||||
private var onTimeEggGachaComplete:Function;
|
||||
|
||||
private var onTimeEggBuyComplete:Function;
|
||||
|
||||
private var timeEggBuy_buffid:uint;
|
||||
|
||||
public function GachaCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : GachaCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(GachaCenter) as GachaCenter;
|
||||
}
|
||||
|
||||
public function gacha(machineID:String = "", num:int = 0, useTicket:int = 0, onComplete:Function = null, traceInfo:Object = null, sliceEggs:Boolean = true) : void
|
||||
{
|
||||
onGachaComplete = onComplete;
|
||||
var cur:GachaVo = new GachaVo();
|
||||
cur.id = machineID;
|
||||
var needMoney:int = 0;
|
||||
var needKe:int = 0;
|
||||
var needTicket:int = useTicket;
|
||||
if(cur.money > 0)
|
||||
{
|
||||
needMoney = (num - useTicket) * cur.money;
|
||||
}
|
||||
else
|
||||
{
|
||||
needKe = (num - useTicket) * cur.ke;
|
||||
}
|
||||
gacha_para = {
|
||||
"sliceEggs":sliceEggs,
|
||||
"num":num,
|
||||
"useTicket":useTicket,
|
||||
"itemType":cur.item,
|
||||
"needKe":needKe,
|
||||
"needMoney":needMoney
|
||||
};
|
||||
if(MyrCenter.channel == "XDG" && !GuideCenter.getIns().checkFin("first10gacha") && cur.ke > 0 && num >= 10)
|
||||
{
|
||||
MyrAne.track("firstgacha");
|
||||
GuideCenter.getIns().fin("first10gacha");
|
||||
}
|
||||
NetGacha.getIns().gacha(machineID,num,needTicket,gachaHandler,traceInfo);
|
||||
}
|
||||
|
||||
private function gachaHandler(reEggs:Array, getMoney:int = 0, getItem:Object = null) : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var egg:EggVo = null;
|
||||
var sliceEgg:EggVo = null;
|
||||
var getitemVo:ItemVo = null;
|
||||
var item:ItemVo = BagCenter.getIns().getByType(gacha_para.itemType);
|
||||
if(gacha_para.useTicket > 0)
|
||||
{
|
||||
BagCenter.getIns().subNum(item.id,gacha_para.useTicket,true);
|
||||
}
|
||||
if(gacha_para.needKe > 0)
|
||||
{
|
||||
MasterCenter.getIns().addKe(-gacha_para.needKe,true);
|
||||
}
|
||||
if(gacha_para.needMoney > 0)
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-gacha_para.needMoney,true);
|
||||
}
|
||||
if(getMoney > 0)
|
||||
{
|
||||
MasterCenter.getIns().addMoney(getMoney,true);
|
||||
}
|
||||
var eggs:Array = [];
|
||||
for(j = 0; j < reEggs.length; )
|
||||
{
|
||||
egg = BagCenter.getItemByItemData(reEggs[j]) as EggVo;
|
||||
while(gacha_para.sliceEggs == true && egg.num > 1)
|
||||
{
|
||||
sliceEgg = new EggVo();
|
||||
sliceEgg.num = 1;
|
||||
sliceEgg.type = egg.type;
|
||||
sliceEgg.id = egg.id;
|
||||
egg.num--;
|
||||
eggs.push(sliceEgg);
|
||||
}
|
||||
trace(egg.num);
|
||||
eggs.push(egg);
|
||||
j++;
|
||||
}
|
||||
eggs = Random.randomArr(eggs);
|
||||
BagCenter.getIns().addItems(eggs);
|
||||
if(getItem != null)
|
||||
{
|
||||
getitemVo = new ItemVo();
|
||||
getitemVo.readObject(getItem);
|
||||
getitemVo.num = gacha_para.num;
|
||||
getitemVo.type = getItem.typeId;
|
||||
BagCenter.getIns().addItem(getitemVo);
|
||||
}
|
||||
onGachaComplete(eggs);
|
||||
}
|
||||
|
||||
public function timeEggGacha(onComplete:Function) : void
|
||||
{
|
||||
onTimeEggGachaComplete = onComplete;
|
||||
NetGacha.getIns().timeEggGacha(timeEggGachaHandler);
|
||||
}
|
||||
|
||||
public function timeEggGachaHandler(re:Object) : void
|
||||
{
|
||||
Master.history.timeEggItems.push(re.timeGacha);
|
||||
if(onTimeEggGachaComplete != null)
|
||||
{
|
||||
onTimeEggGachaComplete(re.timeGacha);
|
||||
onTimeEggGachaComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function timeEggBuy(id:uint, onComplete:Function) : void
|
||||
{
|
||||
onTimeEggBuyComplete = onComplete;
|
||||
timeEggBuy_buffid = id;
|
||||
NetGacha.getIns().timeEggBuy(id,timeEggBuyHandler);
|
||||
}
|
||||
|
||||
public function timeEggBuyHandler(re:Object) : void
|
||||
{
|
||||
var resultStr:String = null;
|
||||
var i:int = 0;
|
||||
var showEggVo:EggVo = null;
|
||||
BagCenter.getIns().subNumByType(Table.game_setting["timeEggItem"],1,true,lang("使用了{0} 个 {1}"));
|
||||
RewardCenter.getIns().getRewardByData(re.reward,false);
|
||||
for each(var o:Object in Master.history.timeEggItems)
|
||||
{
|
||||
if(o.id == timeEggBuy_buffid)
|
||||
{
|
||||
o.selected = true;
|
||||
resultStr = o.result;
|
||||
}
|
||||
}
|
||||
var monEggTypes:Array = resultStr.split(",");
|
||||
var showEggs:Array = [];
|
||||
for(i = 0; i < monEggTypes.length; )
|
||||
{
|
||||
showEggVo = new EggVo();
|
||||
showEggVo.type = monEggTypes[i];
|
||||
showEggVo.num = 1;
|
||||
showEggs.push(showEggVo);
|
||||
i++;
|
||||
}
|
||||
RewardShowPanel.show(showEggs,null,false);
|
||||
if(Boolean(onTimeEggBuyComplete))
|
||||
{
|
||||
onTimeEggBuyComplete();
|
||||
onTimeEggBuyComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTimeEggItemNum() : int
|
||||
{
|
||||
return BagCenter.getIns().getNum(Table.game_setting["timeEggItem"]);
|
||||
}
|
||||
|
||||
public function getTimeEggLeftGacha() : int
|
||||
{
|
||||
return Table.game_setting["timeEggNum"] - Master.history.timeEggItems.length;
|
||||
}
|
||||
|
||||
public function getSelectedTimeEggItem() : Object
|
||||
{
|
||||
for each(var o:Object in Master.history.timeEggItems)
|
||||
{
|
||||
if(o.selected == true)
|
||||
{
|
||||
return o;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.system.Capabilities;
|
||||
import net.gaooo.nano.center.GAoNano;
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.element.SettingVo;
|
||||
import net.pixvi.myr.element.master.MasterVo;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class Game extends Singleton
|
||||
{
|
||||
|
||||
public var master:MasterVo;
|
||||
|
||||
public var setting:SettingVo;
|
||||
|
||||
public function Game()
|
||||
{
|
||||
super();
|
||||
if(Saver.getAuto("myrSetting") == null)
|
||||
{
|
||||
setting = new SettingVo();
|
||||
if(MobiTools.isMobi() && Capabilities.screenResolutionY / Capabilities.screenResolutionX >= 2)
|
||||
{
|
||||
setting.liuhaiMode = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setting = PiObject.readPiObj(Saver.getAuto("myrSetting")) as SettingVo;
|
||||
if(setting == null)
|
||||
{
|
||||
setting = new SettingVo();
|
||||
if(MobiTools.isMobi() && Capabilities.screenResolutionY / Capabilities.screenResolutionX >= 2)
|
||||
{
|
||||
setting.liuhaiMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIns() : Game
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(Game) as Game;
|
||||
}
|
||||
|
||||
public static function get HQ() : Boolean
|
||||
{
|
||||
return getIns().setting.quality == 3;
|
||||
}
|
||||
|
||||
public static function get LQ() : Boolean
|
||||
{
|
||||
return getIns().setting.quality == 1;
|
||||
}
|
||||
|
||||
public static function exit(e:Event = null) : void
|
||||
{
|
||||
MobiTools.getIns().exit();
|
||||
}
|
||||
|
||||
public function beforeGroundCheck() : void
|
||||
{
|
||||
MasterCenter.getIns().inJectGAoPara();
|
||||
MonsterCenter.getIns().secondHandler(false);
|
||||
MailCenter.getIns().autoCheckMailDay();
|
||||
}
|
||||
|
||||
public function saveSetting() : void
|
||||
{
|
||||
Saver.saveAuto("myrSetting",setting.toObject());
|
||||
}
|
||||
|
||||
public function initSetting() : void
|
||||
{
|
||||
if(!setting.openBgm)
|
||||
{
|
||||
SoundCenter.getIns().setBgmEnable(false);
|
||||
GAoNano.getIns().volume = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundCenter.getIns().bgmVolume = setting.globalVolume;
|
||||
GAoNano.getIns().volume = setting.globalVolume;
|
||||
}
|
||||
if(!setting.openEffect)
|
||||
{
|
||||
SoundCenter.getIns().setEffectEnable(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundCenter.getIns().effectVolume = setting.globalVolume;
|
||||
}
|
||||
}
|
||||
|
||||
public function getLiuHaiAdd() : int
|
||||
{
|
||||
if(MyrCenter.platform == "IOS")
|
||||
{
|
||||
return 75;
|
||||
}
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.StatusEvent;
|
||||
import flash.text.TextField;
|
||||
import flash.utils.Timer;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.driver.SecondDriver;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.driver.TimerDriver;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetMaster;
|
||||
import net.pixvi.myr.panel.login.PressStartPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.driver.EnterFrameDriver;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pse.file.FileTools;
|
||||
import net.pixvi.psg.driver.GuideDriver;
|
||||
|
||||
public class GameCenter extends Singleton
|
||||
{
|
||||
|
||||
public static var tf:TextField;
|
||||
|
||||
private var heartbeatTimer:Timer;
|
||||
|
||||
private var gameStart:Boolean = false;
|
||||
|
||||
public var inGameDay:Number;
|
||||
|
||||
public var safeModeAge:int = 0;
|
||||
|
||||
public var endcheck:Boolean = false;
|
||||
|
||||
public var checkNum:int = 0;
|
||||
|
||||
public function GameCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function traceMode(txt:String, err:Boolean = false) : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function getIns() : GameCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(GameCenter) as GameCenter;
|
||||
}
|
||||
|
||||
public function startGame() : void
|
||||
{
|
||||
heartbeatTimer = new Timer(240000);
|
||||
gameStart = true;
|
||||
TimerDriver.getInstance().regist(NetMaster.getIns().heartBeating,heartbeatTimer,true);
|
||||
SecondDriver.getIns().regist(checkDayChange);
|
||||
SecondDriver.getIns().regist(BossCenter.getIns().secondCheck);
|
||||
NetMaster.getIns().heartBeating();
|
||||
GuideDriver.getIns().traceMode = GameMath.ModeTrace;
|
||||
}
|
||||
|
||||
public function userAuth(e:Object) : void
|
||||
{
|
||||
var idcard:String = null;
|
||||
if(e is Event)
|
||||
{
|
||||
if(e is StatusEvent)
|
||||
{
|
||||
idcard = (e as StatusEvent).code;
|
||||
}
|
||||
else
|
||||
{
|
||||
idcard = e.data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
idcard = e.toString();
|
||||
}
|
||||
var year:int = int(idcard.substr(6,4));
|
||||
var month:int = int(idcard.substr(10,2)) - 1;
|
||||
var day:int = int(idcard.substr(12,2));
|
||||
var date:Date = new Date(year,month,day);
|
||||
var birthday:int = MyrCalendar.getDayNumber(date.time);
|
||||
var curday:int = MyrCalendar.getDayNumber(new Date().time);
|
||||
var age:int = (curday - birthday) / 365;
|
||||
if(idcard.length < 16)
|
||||
{
|
||||
age = 100;
|
||||
}
|
||||
safeModeAge = age;
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.yes("实名","实名认证年龄:" + age);
|
||||
}
|
||||
if(age < 18 && MyrCenter.channel == "DYD")
|
||||
{
|
||||
Alert.yes("实名认证完成","请重新进入游戏并登录。",MobiTools.getIns().exit);
|
||||
}
|
||||
}
|
||||
|
||||
public function returnLogin() : void
|
||||
{
|
||||
while(PopCenter.getIns().topPanel != null)
|
||||
{
|
||||
PopCenter.getIns().topPanel.showOut();
|
||||
}
|
||||
GameCenter.getIns().resetGame();
|
||||
PressStartPanel.getIns().reload();
|
||||
PressStartPanel.getIns().popIn();
|
||||
}
|
||||
|
||||
public function clickSafeTime(id:String, add:Boolean = false) : void
|
||||
{
|
||||
var prevClick:Number = NaN;
|
||||
var countTime:int = 0;
|
||||
var prevDay:int = 0;
|
||||
var curDay:int = 0;
|
||||
if(endcheck)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!GameMath.ModeTrace && GameMath.ModeRealName && Table.setting.safeModeAge != null && safeModeAge < Table.setting.safeModeAge && Table.setting.safeModeTime != null && Table.setting.safeModeTime > 0)
|
||||
{
|
||||
prevClick = 0;
|
||||
if(Saver.getAuto(id + "clickTime") != null)
|
||||
{
|
||||
prevClick = Number(Saver.getAuto(id + "clickTime"));
|
||||
}
|
||||
if(MyrCalendar.getShowDate().hours > Table.setting.safeModeTimeClose || MyrCalendar.getShowDate().hours < Table.setting.safeModeTimeOpen)
|
||||
{
|
||||
Alert.yes("防沉迷系统","今日游戏时间已结束,还是休息一下吧!",MobiTools.getIns().exit);
|
||||
return;
|
||||
}
|
||||
countTime = 0;
|
||||
if(Saver.getAuto(id + "countTime") != null)
|
||||
{
|
||||
countTime = Number(Saver.getAuto(id + "countTime"));
|
||||
}
|
||||
prevDay = MyrCalendar.getDayNumber(prevClick * 1000);
|
||||
curDay = MyrCalendar.getDayNumber();
|
||||
if(prevDay != curDay && !AccountCenter.getIns().isVisitor)
|
||||
{
|
||||
Saver.saveAuto(id + "countTime",0);
|
||||
countTime = 0;
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("防沉迷调试:跨天清零");
|
||||
}
|
||||
}
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(countTime > Table.setting.safeModeTime)
|
||||
{
|
||||
endcheck = true;
|
||||
Alert.yes("防沉迷系统","今日游戏时间:" + int(Table.setting.safeModeTime / 60) + "分钟,已超过未成年人每日游戏时间,还是休息一下吧!",MobiTools.getIns().exit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(add)
|
||||
{
|
||||
countTime += 20;
|
||||
}
|
||||
Saver.saveAuto(id + "countTime",countTime);
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("防沉累加:60s 今日:" + countTime + "s");
|
||||
}
|
||||
}
|
||||
Saver.saveAuto(id + "clickTime",TimeCenter.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
public function countSafeTime(id:String, add:Boolean = false) : Number
|
||||
{
|
||||
var countTime:int = 0;
|
||||
if(GameMath.ModeRealName && Table.setting.safeModeTime != null && Table.setting.safeModeTime > 0)
|
||||
{
|
||||
clickSafeTime(id,add);
|
||||
countTime = 0;
|
||||
if(Saver.getAuto(id + "countTime") != null)
|
||||
{
|
||||
countTime = Number(Saver.getAuto(id + "countTime"));
|
||||
}
|
||||
return countTime;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function countSafeTimePass(id:String, add:Boolean = false) : Boolean
|
||||
{
|
||||
var todaySafetime:int = 0;
|
||||
var safetime:int = 0;
|
||||
trace("check",GameMath.ModeRealName,Table.setting.safeModeTime,Table.setting.safeModeTime);
|
||||
if(!GameMath.ModeTrace && GameMath.ModeRealName && Table.setting.safeModeAge != null && safeModeAge < Table.setting.safeModeAge && Table.setting.safeModeTime != null && Table.setting.safeModeTime > 0)
|
||||
{
|
||||
todaySafetime = countSafeTime(id,add);
|
||||
safetime = int(Table.setting.safeModeTime);
|
||||
return todaySafetime <= safetime;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function resetGame() : void
|
||||
{
|
||||
MonsterCenter.getIns().reset();
|
||||
TimerDriver.getInstance().remove(NetMaster.getIns().heartBeating,heartbeatTimer,true);
|
||||
SecondDriver.getIns().remove(checkDayChange);
|
||||
SecondDriver.getIns().remove(BossCenter.getIns().secondCheck);
|
||||
}
|
||||
|
||||
public function inFunction() : void
|
||||
{
|
||||
EnterFrameDriver.getInstance().resume();
|
||||
SecondDriver.getInstance().resume();
|
||||
TimeCenter.getIns().startTimeSynchro();
|
||||
}
|
||||
|
||||
public function outFunction() : void
|
||||
{
|
||||
EnterFrameDriver.getInstance().pause();
|
||||
SecondDriver.getInstance().pause();
|
||||
}
|
||||
|
||||
public function userChangeInGame(e:Object = null) : void
|
||||
{
|
||||
Alert.yes("提示","账号已切换,请重新进入游戏。",MobiTools.getIns().exit);
|
||||
}
|
||||
|
||||
public function checkDayChange() : void
|
||||
{
|
||||
var day:int = Calendar.getDayNumber();
|
||||
if(inGameDay != day)
|
||||
{
|
||||
inGameDay = day;
|
||||
Master.history.payTypeDayCount = {};
|
||||
BossCenter.getIns().dayPass();
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.DAY_CHANGE));
|
||||
}
|
||||
}
|
||||
|
||||
public function roboCheck() : void
|
||||
{
|
||||
if(GameMath.ModeTrace || true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
FileTools.silentSaveTextFile(FileTools.applicationStorageDirectory.resolvePath("autosystem.txt"),"1");
|
||||
Alert.yes("警告","疑似脚本账号,账号将被加入监控范围,请回答以下问题。",roboCheck1);
|
||||
}
|
||||
|
||||
public function roboCheck1() : void
|
||||
{
|
||||
switch(Random.integer(1,5) - 1)
|
||||
{
|
||||
case 0:
|
||||
Alert.yesno("调查","是否正在使用挂机脚本?",roboCheckFalse,roboCheckRight,"确定","取消",false);
|
||||
break;
|
||||
case 1:
|
||||
Alert.yesno("调查","是否正常游戏而没有使用挂机脚本?",roboCheckRight,roboCheckFalse,"确定","取消",false);
|
||||
break;
|
||||
case 2:
|
||||
Alert.yesno("调查","是否购买自其他平台出售的初始账号?",roboCheckFalse,roboCheckRight,"确定","取消",false);
|
||||
break;
|
||||
case 3:
|
||||
Alert.yesno("调查",Random.integer(1,45) + "是否大于" + Random.integer(49,100),roboCheckFalse,roboCheckRight,"确定","取消",false);
|
||||
break;
|
||||
case 4:
|
||||
Alert.yesno("调查",Random.integer(1,45) + "是否小于" + Random.integer(49,100),roboCheckRight,roboCheckFalse,"确定","取消",false);
|
||||
}
|
||||
}
|
||||
|
||||
public function roboCheckRight() : void
|
||||
{
|
||||
checkNum++;
|
||||
if(checkNum > 6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
roboCheck1();
|
||||
}
|
||||
|
||||
public function roboCheckFalse() : void
|
||||
{
|
||||
checkNum = 0;
|
||||
roboCheck1();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
|
||||
public class GameTools
|
||||
{
|
||||
|
||||
public static var words:Array;
|
||||
|
||||
public static var chars:String = " ,<>.{}[]-_=+`~/?!@#$%^&*|\\/\"\';:";
|
||||
|
||||
public function GameTools()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function checkWord(str:String) : String
|
||||
{
|
||||
var i:int = 0;
|
||||
if(MyrCenter.lang == "JP")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var len:int = int(words.length);
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if(str.indexOf(words[i]) != -1)
|
||||
{
|
||||
return words[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function checkChar(str:String) : String
|
||||
{
|
||||
var i:int = 0;
|
||||
if(chars == null || chars.length <= 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var len:int = str.length;
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if(chars.indexOf(str.charAt(i)) != -1)
|
||||
{
|
||||
return str.charAt(i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.guide.GMain;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.room.RoomVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.net.NetMaster;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class GuideCenter extends Singleton
|
||||
{
|
||||
|
||||
public static var guideFixed:Boolean = false;
|
||||
|
||||
public function GuideCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : GuideCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(GuideCenter) as GuideCenter;
|
||||
}
|
||||
|
||||
public static function guideFix() : void
|
||||
{
|
||||
trace("fixguide");
|
||||
if(guideFixed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
guideFixed = true;
|
||||
var fmgtaskfin:Boolean = Boolean(GuideCenter.getIns().checkFin(GSub.TASK_STATUS_BUILD));
|
||||
var fmgtask:TaskVo = TaskCenter.getIns().getLocalTaskByTypeId("1001012");
|
||||
if(!fmgtaskfin && fmgtask != null)
|
||||
{
|
||||
for each(var roomvo:RoomVo in Master.rooms)
|
||||
{
|
||||
if(roomvo.type != 1001)
|
||||
{
|
||||
TaskCenter.getIns().activityLockStatus(GSub.TASK_STATUS_BUILD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function fin(guideType:String = "auto", update:Boolean = true) : void
|
||||
{
|
||||
if(guideType == "auto")
|
||||
{
|
||||
guideType = Master.history.guide_main;
|
||||
}
|
||||
if(checkCur(guideType))
|
||||
{
|
||||
Master.history.guide_main = GMain.Process[GMain.Process.indexOf(Master.history.guide_main) + 1];
|
||||
if(update)
|
||||
{
|
||||
if(Master.history.guide_record[guideType] != true)
|
||||
{
|
||||
NetMaster.getIns().updateGuide(Master.history.guide_main,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(Master.history.guide_record[guideType] != true)
|
||||
{
|
||||
NetMaster.getIns().updateGuide(guideType,false);
|
||||
}
|
||||
Master.history.guide_record[guideType] = true;
|
||||
}
|
||||
|
||||
public function checkCur(guideType:String) : Boolean
|
||||
{
|
||||
return Master.history.guide_main == guideType;
|
||||
}
|
||||
|
||||
public function checkFin(guideType:String) : Boolean
|
||||
{
|
||||
return Master.history.guide_record[guideType] == true;
|
||||
}
|
||||
|
||||
public function checkFreshGuideFinish() : Boolean
|
||||
{
|
||||
return Master.history.passTask["1001004"] == true;
|
||||
}
|
||||
|
||||
public function checkOnceFirstGuideMode() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
if(Table.game_setting.openOnceFirstGuide == true)
|
||||
{
|
||||
if(Master.history.passTask["1001004"] == true)
|
||||
{
|
||||
Master.history.guide_main = "goWildOver";
|
||||
for(i = 0; i < GMain.Process.length; )
|
||||
{
|
||||
Master.history.guide_record[GMain.Process[i]] = true;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import net.pixvi.common.driver.StageDriver;
|
||||
import net.pixvi.common.utils.PiFixVo;
|
||||
import net.pixvi.common.utils.StageLocator;
|
||||
import net.pixvi.common.view.FF;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.pfw.display.BitFactory;
|
||||
import net.pixvi.pfw.display.BitSprite;
|
||||
import net.pixvi.pfw.display.NetBitImg;
|
||||
import net.pixvi.pfw.display.PiSprite;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class ImgCenter extends Singleton
|
||||
{
|
||||
|
||||
private static var fsMaskUp:BitSprite;
|
||||
|
||||
private static var fsMaskDown:BitSprite;
|
||||
|
||||
public static var rankDic:Object = {
|
||||
"-1":"0",
|
||||
"0":"C",
|
||||
"1":"C",
|
||||
"2":"B",
|
||||
"3":"A",
|
||||
"4":"S",
|
||||
"5":"S"
|
||||
};
|
||||
|
||||
public static var elementDic:Object = {
|
||||
"1":"water",
|
||||
"2":"fire",
|
||||
"3":"ground",
|
||||
"4":"wind",
|
||||
"5":"none"
|
||||
};
|
||||
|
||||
public function ImgCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function addFsMask(container:DisplayObjectContainer, mode:String = "fs1") : void
|
||||
{
|
||||
var vo:PiFixVo = StageLocator.SubFixVos[mode];
|
||||
if(vo.hasFix)
|
||||
{
|
||||
if(fsMaskUp == null)
|
||||
{
|
||||
fsMaskUp = FF.getBS("ui.FsMask");
|
||||
fsMaskDown = FF.getBS("ui.FsMask");
|
||||
fsMaskDown.scaleY = -1;
|
||||
}
|
||||
fsMaskUp.y = vo.fix[0];
|
||||
fsMaskDown.y = StageDriver.stageHeight + vo.fix[2];
|
||||
container.addChild(fsMaskUp);
|
||||
container.addChild(fsMaskDown);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getBrickHeroImg(type:int = 1) : Bitmap
|
||||
{
|
||||
return FF.getBM("hero.type" + type,"auto",true);
|
||||
}
|
||||
|
||||
public static function getItemBgImg(itemOrEggOrMon:Object = null, LM:String = "L") : String
|
||||
{
|
||||
var lv:int = 1;
|
||||
if(itemOrEggOrMon is EggVo)
|
||||
{
|
||||
lv = int(itemOrEggOrMon.star);
|
||||
}
|
||||
else if(itemOrEggOrMon is MonsterVo)
|
||||
{
|
||||
lv = int(itemOrEggOrMon.star);
|
||||
}
|
||||
else
|
||||
{
|
||||
lv = int(itemOrEggOrMon.quality);
|
||||
}
|
||||
return "data/img/common/common_items_" + lv + "_" + LM + ".png";
|
||||
}
|
||||
|
||||
public static function getItemBgImgByRank(rank:int, LM:String = "L") : String
|
||||
{
|
||||
return "data/img/common/common_items_" + rank + "_" + LM + ".png";
|
||||
}
|
||||
|
||||
public static function getStarImg(star:int) : String
|
||||
{
|
||||
return "data/img/common/common_stars_" + star + ".png";
|
||||
}
|
||||
|
||||
public static function getItemImg(type:int, small:Boolean = false, ornament:Boolean = false) : String
|
||||
{
|
||||
if(small)
|
||||
{
|
||||
return "data/img/item/s/item_" + type + "_s.png";
|
||||
}
|
||||
if(ornament)
|
||||
{
|
||||
return "data/img/item/item_" + type + "_o.png";
|
||||
}
|
||||
return "data/img/item/item_" + type + ".png";
|
||||
}
|
||||
|
||||
public static function getMonCardFront(star:int = 1, rank:int = 1) : String
|
||||
{
|
||||
return "data/img/common/monsterframe_rank" + rankDic[rank] + "_" + star + ".png";
|
||||
}
|
||||
|
||||
public static function getMonMidCardFront(rank:int = 1) : String
|
||||
{
|
||||
return "data/img/common/array_frame_rank" + rankDic[rank] + ".png";
|
||||
}
|
||||
|
||||
public static function getMonCardBack(rank:int = 1) : String
|
||||
{
|
||||
return "data/img/common/monsterframe_rank" + rankDic[rank] + "_botm.png";
|
||||
}
|
||||
|
||||
public static function getMonElement(element:int) : String
|
||||
{
|
||||
return "data/img/common/monsterframe_attrib_" + elementDic[element] + ".png";
|
||||
}
|
||||
|
||||
public static function getMonGroup(ground:int) : String
|
||||
{
|
||||
return "data/img/common/group" + ground + ".png";
|
||||
}
|
||||
|
||||
public static function skillIcon(type:int) : String
|
||||
{
|
||||
return "data/img/skill/skill_" + type + ".png";
|
||||
}
|
||||
|
||||
public static function getAchiTagImg(achiTag:String) : String
|
||||
{
|
||||
return "data/img/common/myroom_achv_class_" + achiTag + ".png";
|
||||
}
|
||||
|
||||
public static function farmEventImg(img:String) : String
|
||||
{
|
||||
return "data/img/farmevent/farmevent_" + img + ".png";
|
||||
}
|
||||
|
||||
public static function getMonFullCardImg(type:int, equips:Array = null, reFixQ:Boolean = false) : PiSprite
|
||||
{
|
||||
var i:int = 0;
|
||||
var equipData:Object = null;
|
||||
var equipImg:NetBitImg = null;
|
||||
var equipContainer:PiSprite = null;
|
||||
var ofix:Object = null;
|
||||
var s:PiSprite = new PiSprite();
|
||||
var monImg:NetBitImg = new NetBitImg(getMonQImg(type,2));
|
||||
var monImgFix:Object = getMonQFix(type,2);
|
||||
monImg.x = monImgFix.x;
|
||||
monImg.y = monImgFix.y;
|
||||
s.addChild(monImg);
|
||||
for(i = 0; i < equips.length; )
|
||||
{
|
||||
if(equips[i] > 0)
|
||||
{
|
||||
if(Table.item_info[equips[i]].position.position != "0")
|
||||
{
|
||||
equipData = Table.item_info[equips[i]];
|
||||
equipImg = new NetBitImg(getItemImg(equips[i],false,equipData.position.img));
|
||||
equipContainer = new PiSprite();
|
||||
equipContainer.addChild(equipImg);
|
||||
ofix = getMonOrnamentFix(type,2,equipData.position.position);
|
||||
equipImg.x = equipData.position.floatX;
|
||||
equipImg.y = equipData.position.floatY;
|
||||
equipImg.setScale(equipData.position.scale);
|
||||
equipImg.rotation = equipData.position.rotation;
|
||||
equipContainer.x = ofix.x;
|
||||
equipContainer.y = ofix.y;
|
||||
if(ofix.rotation != null)
|
||||
{
|
||||
equipContainer.rotation = ofix.rotation;
|
||||
}
|
||||
if(ofix.hide != null)
|
||||
{
|
||||
equipContainer.visible = ofix.hide;
|
||||
}
|
||||
else
|
||||
{
|
||||
equipContainer.visible = true;
|
||||
}
|
||||
if(equipData.position.front)
|
||||
{
|
||||
s.addChild(equipContainer);
|
||||
}
|
||||
else
|
||||
{
|
||||
s.addChildAt(equipContainer,s.getChildIndex(monImg));
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(reFixQ)
|
||||
{
|
||||
s.x -= monImgFix.x;
|
||||
s.y -= monImgFix.y;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static function getBattleMonBoard(quality:int) : String
|
||||
{
|
||||
return "data/img/common/battle_monster" + rankDic[quality] + ".png";
|
||||
}
|
||||
|
||||
public static function getMonsterCGImg(type:int, upStar:int = 0) : String
|
||||
{
|
||||
if(upStar == 0)
|
||||
{
|
||||
return "data/img/monster/l/" + type + "_l_0.png";
|
||||
}
|
||||
try
|
||||
{
|
||||
return getMonsterCGImg(Table.upstar_info[type].skin[upStar][upStar]);
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
var _loc5_:String = "";
|
||||
}
|
||||
return _loc5_;
|
||||
}
|
||||
|
||||
public static function getBattleImgByGroundType(groundType:String) : String
|
||||
{
|
||||
return "data/img/bg/" + Table.setting.groundType[groundType].battleImg;
|
||||
}
|
||||
|
||||
public static function getEntangleSkillIcon(type:String) : String
|
||||
{
|
||||
return "data/img/eskill/e_" + type + ".png";
|
||||
}
|
||||
|
||||
public static function gcMonsterImg(type:int, l:Boolean = true) : void
|
||||
{
|
||||
BitFactory.removeBitmapDataMapping(getMonsterCGImg(type));
|
||||
}
|
||||
|
||||
public static function getMonQImg(type:int, mode:int, tag:String = "") : String
|
||||
{
|
||||
return "data/img/monster/q/" + type + "_q_" + mode + tag + ".png";
|
||||
}
|
||||
|
||||
public static function getMonAvatar(type:int) : String
|
||||
{
|
||||
return "data/img/monster/a/" + type + "_a_0.png";
|
||||
}
|
||||
|
||||
public static function getMonQFix(type:int, mode:int, tag:String = "") : Object
|
||||
{
|
||||
return Table.monster_info[type].imgFix[mode + tag];
|
||||
}
|
||||
|
||||
public static function getMonTagFix(type:int, tag:String = "l") : Object
|
||||
{
|
||||
return Table.monster_info[type].imgFix[tag];
|
||||
}
|
||||
|
||||
public static function getMonOrnamentFix(type:int, mode:int, position:int, tag:String = "") : Object
|
||||
{
|
||||
return Table.monster_info[type].ornamentFix[position.toString()][mode + tag];
|
||||
}
|
||||
|
||||
public static function hasMonQImg(type:int, mode:int, tag:String = "") : Boolean
|
||||
{
|
||||
return getMonQFix(type,mode,tag) != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.lib.LibEquipVo;
|
||||
import net.pixvi.myr.element.lib.LibTypeVo;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class LibCenter extends Singleton
|
||||
{
|
||||
|
||||
public var curLibVo:LibTypeVo;
|
||||
|
||||
public function LibCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : LibCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(LibCenter) as LibCenter;
|
||||
}
|
||||
|
||||
public function getUnlockLibs() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var unlockLibs:Array = [];
|
||||
var libs:Array = getLibs();
|
||||
for(i = 0; i < libs.length; )
|
||||
{
|
||||
if((libs[i] as LibTypeVo).unlock)
|
||||
{
|
||||
unlockLibs.push(libs[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return unlockLibs;
|
||||
}
|
||||
|
||||
public function getLibs() : Array
|
||||
{
|
||||
var libvo:LibTypeVo = null;
|
||||
var i:int = 0;
|
||||
var libVos:Array = [];
|
||||
for each(var vo:Object in Table.monster_infoArr)
|
||||
{
|
||||
if(!vo.hideLib)
|
||||
{
|
||||
libvo = new LibTypeVo();
|
||||
libvo.monType = vo.type;
|
||||
libVos.push(libvo);
|
||||
}
|
||||
}
|
||||
libVos.sortOn("sort",16);
|
||||
for(i = 0; i < libVos.length; )
|
||||
{
|
||||
libVos[i].no = i + 1;
|
||||
i++;
|
||||
}
|
||||
return libVos;
|
||||
}
|
||||
|
||||
public function getLibByType(monType:int) : LibTypeVo
|
||||
{
|
||||
var a:Object = ArrayUtil.getElementByValue(getLibs(),"monType",monType);
|
||||
if(a == null)
|
||||
{
|
||||
Alert.yes("error","Can\'t find monLib type[" + monType + "]");
|
||||
}
|
||||
return ArrayUtil.getElementByValue(getLibs(),"monType",monType) as LibTypeVo;
|
||||
}
|
||||
|
||||
public function getEquipLibs() : Array
|
||||
{
|
||||
var libvo:LibEquipVo = null;
|
||||
var libVos:Array = [];
|
||||
var nos:Object = {
|
||||
"1":0,
|
||||
"2":0,
|
||||
"3":0,
|
||||
"4":0,
|
||||
"5":0,
|
||||
"6":0
|
||||
};
|
||||
for each(var vo:Object in Table.item_info)
|
||||
{
|
||||
if(vo.itemType == ItemType.TYPE_EQUIP && vo.hideLib != true)
|
||||
{
|
||||
libvo = new LibEquipVo();
|
||||
libvo.equipType = vo.type;
|
||||
if(libvo.part <= 3)
|
||||
{
|
||||
libvo.no = nos[libvo.quality.toString()] + 1;
|
||||
nos[libvo.quality.toString()]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
libvo.no = nos[6] + 1;
|
||||
nos[6]++;
|
||||
}
|
||||
libVos.push(libvo);
|
||||
}
|
||||
}
|
||||
libVos.sortOn("sort",16);
|
||||
return libVos;
|
||||
}
|
||||
|
||||
public function getEquipUnlockLibs() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var unlockLibs:Array = [];
|
||||
var libs:Array = getEquipLibs();
|
||||
for(i = 0; i < libs.length; )
|
||||
{
|
||||
if((libs[i] as LibEquipVo).unlock)
|
||||
{
|
||||
unlockLibs.push(libs[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return unlockLibs;
|
||||
}
|
||||
|
||||
public function countEquipLibs() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var vo:Object in Table.item_info)
|
||||
{
|
||||
if(vo.itemType == ItemType.TYPE_EQUIP && !vo.hideLib)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function countLibs() : int
|
||||
{
|
||||
var num:int = 0;
|
||||
for each(var vo:Object in Table.monster_infoArr)
|
||||
{
|
||||
if(!vo.hideLib)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function unlockLib(type:int, show:Boolean = true) : void
|
||||
{
|
||||
Master.history.monLib.push(type);
|
||||
LibTypeVo.newType.push(type);
|
||||
if(show)
|
||||
{
|
||||
StatusCenter.getIns().unlockMonster(type);
|
||||
}
|
||||
}
|
||||
|
||||
public function getNumUnlockByMonTypes(types:Array) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var num:int = 0;
|
||||
for(i = 0; i < types.length; )
|
||||
{
|
||||
if(Master.history.monLib.indexOf(types[i]) != -1)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function checkUnlock(type:int) : Boolean
|
||||
{
|
||||
return Master.history.monLib.indexOf(type) >= 0;
|
||||
}
|
||||
|
||||
public function checkEquipUnlock(type:int) : Boolean
|
||||
{
|
||||
return Master.history.equipLib.indexOf(type.toString()) >= 0;
|
||||
}
|
||||
|
||||
public function checkUnlocks(types:Array) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < types.length; )
|
||||
{
|
||||
if(!checkUnlock(types[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,355 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.element.msg.MailVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetMail;
|
||||
import net.pixvi.myr.net.NetMiniGame;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class MailCenter
|
||||
{
|
||||
|
||||
private static const MAIL_COLLECT_TYPE_ID:String = "mailCollectList";
|
||||
|
||||
private var firstUpdate:Boolean = true;
|
||||
|
||||
private var onAutoGetMailListComplete:Function;
|
||||
|
||||
private var getMail_mail:MailVo;
|
||||
|
||||
private var onGetMailRewardComplete:Function;
|
||||
|
||||
private var removeMails_removemails:Array;
|
||||
|
||||
private var onRemoveMailsComplete:Function;
|
||||
|
||||
public var collectMails:Array = null;
|
||||
|
||||
private var _onLoadCollectComplete:Function;
|
||||
|
||||
public function MailCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getMailByMailData(mailData:Object) : MailVo
|
||||
{
|
||||
var mail:MailVo = new MailVo();
|
||||
mail.id = mailData.id;
|
||||
mail.title = mailData.title;
|
||||
mail.content = mailData.content;
|
||||
mail.date = mailData.createTime / 1000;
|
||||
mail.read = mailData.isRead == 1;
|
||||
mail.level = mailData.level;
|
||||
if(mailData.reward != null)
|
||||
{
|
||||
mail.reward = Json.decode(mailData.reward);
|
||||
}
|
||||
mail.getReward = mailData.isGetReward == 1;
|
||||
return mail;
|
||||
}
|
||||
|
||||
public static function getIns() : MailCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(MailCenter) as MailCenter;
|
||||
}
|
||||
|
||||
public function pushMail(mail:MailVo) : void
|
||||
{
|
||||
Master.mailBox.mails.push(mail);
|
||||
}
|
||||
|
||||
private function get lastCheckTime() : int
|
||||
{
|
||||
if(Saver.getAuto(Master.id.toString() + "lastMailCheckTime") == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return Number(Saver.getAuto(Master.id.toString() + "lastMailCheckTime"));
|
||||
}
|
||||
|
||||
private function set lastCheckTime(val:int) : void
|
||||
{
|
||||
Saver.saveAuto(Master.id.toString() + "lastMailCheckTime",TimeCenter.timestamp);
|
||||
}
|
||||
|
||||
public function autoGetMailList(onComplete:Function = null) : void
|
||||
{
|
||||
onAutoGetMailListComplete = onComplete;
|
||||
NetMail.getIns().checkNew(autoGetMailListHandler);
|
||||
}
|
||||
|
||||
public function autoGetMailListHandler(maildatas:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mails:Array = null;
|
||||
var i2:int = 0;
|
||||
var mail:MailVo = null;
|
||||
var hasChange:Boolean = false;
|
||||
var hasNew:Boolean = false;
|
||||
for(i = 0; i < maildatas.length; )
|
||||
{
|
||||
if(Master.mailBox.getMailById(maildatas[i].id) == null)
|
||||
{
|
||||
hasChange = true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
var preCheckTime:Number = lastCheckTime;
|
||||
lastCheckTime = TimeCenter.timestamp;
|
||||
if(hasChange)
|
||||
{
|
||||
mails = [];
|
||||
for(i2 = 0; i2 < maildatas.length; )
|
||||
{
|
||||
mail = MailCenter.getMailByMailData(maildatas[i2]);
|
||||
if(!hasNew && mail.date > preCheckTime && !mail.read)
|
||||
{
|
||||
hasNew = true;
|
||||
}
|
||||
mails.push(mail);
|
||||
i2++;
|
||||
}
|
||||
Master.mailBox.mails = mails;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MAIL_UPDATE));
|
||||
}
|
||||
if(hasNew)
|
||||
{
|
||||
Alert.showMsg(lang("收到了新的邮件!"));
|
||||
GameSound.playSysVoice("mail",true,true);
|
||||
}
|
||||
if(onAutoGetMailListComplete != null)
|
||||
{
|
||||
onAutoGetMailListComplete();
|
||||
onAutoGetMailListComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function readMail(id:int) : void
|
||||
{
|
||||
NetMail.getIns().readMail([id]);
|
||||
}
|
||||
|
||||
public function getMailReward(mailvo:MailVo, onComplete:Function) : void
|
||||
{
|
||||
onGetMailRewardComplete = onComplete;
|
||||
getMail_mail = mailvo;
|
||||
NetMail.getIns().getReward(mailvo.id,getMailRewardHandler);
|
||||
}
|
||||
|
||||
private function getMailRewardHandler(re:Object) : void
|
||||
{
|
||||
getMail_mail.getReward = true;
|
||||
RewardCenter.getIns().getRewardByData(re.reward,true,"panel");
|
||||
if(onGetMailRewardComplete != null)
|
||||
{
|
||||
onGetMailRewardComplete();
|
||||
onGetMailRewardComplete = null;
|
||||
getMail_mail = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeMails(ids:Array, onComplete:Function) : void
|
||||
{
|
||||
onRemoveMailsComplete = onComplete;
|
||||
var removeids:Array = [];
|
||||
for each(var m:MailVo in Master.mailBox.mails)
|
||||
{
|
||||
if(ids.indexOf(m.id) != -1 && (!m.hasReward || m.getReward))
|
||||
{
|
||||
removeids.push(m.id);
|
||||
}
|
||||
}
|
||||
removeMails_removemails = removeids;
|
||||
NetMail.getIns().deleteMail(removeids,removeMailsHandler);
|
||||
}
|
||||
|
||||
private function removeMailsHandler(re:Object = null) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mail:MailVo = null;
|
||||
for(i = 0; i < Master.mailBox.mails.length; )
|
||||
{
|
||||
mail = Master.mailBox.mails[i];
|
||||
if(removeMails_removemails.indexOf(mail.id) != -1)
|
||||
{
|
||||
Master.mailBox.mails.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(onRemoveMailsComplete != null)
|
||||
{
|
||||
onRemoveMailsComplete();
|
||||
onRemoveMailsComplete = null;
|
||||
removeMails_removemails = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function autoCheckMailDay() : void
|
||||
{
|
||||
for each(var m:MailVo in Master.mailBox.mails)
|
||||
{
|
||||
if(m.overday <= 0)
|
||||
{
|
||||
ArrayUtil.remove(Master.mailBox.mails,m);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hasNewMail() : Boolean
|
||||
{
|
||||
for each(var m:MailVo in Master.mailBox.mails)
|
||||
{
|
||||
if(!m.read)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get isCollectMailLoaded() : Boolean
|
||||
{
|
||||
return collectMails != null;
|
||||
}
|
||||
|
||||
public function loadCollectMails(onComplete:Function = null) : void
|
||||
{
|
||||
_onLoadCollectComplete = onComplete;
|
||||
NetMiniGame.getIns().loadData("mailCollectList",loadCollectMailsHandler);
|
||||
}
|
||||
|
||||
private function loadCollectMailsHandler(re:Object) : void
|
||||
{
|
||||
var data:Object = null;
|
||||
var i:int = 0;
|
||||
var mailData:Object = null;
|
||||
var mail:MailVo = null;
|
||||
collectMails = [];
|
||||
if(re != null && re.data != null)
|
||||
{
|
||||
data = re.data;
|
||||
if(data is String)
|
||||
{
|
||||
data = Json.decode(data as String);
|
||||
}
|
||||
if(data is Array)
|
||||
{
|
||||
for(i = 0; i < (data as Array).length; )
|
||||
{
|
||||
mailData = (data as Array)[i];
|
||||
mail = new MailVo();
|
||||
mail.id = mailData.id;
|
||||
mail.title = mailData.title;
|
||||
mail.content = mailData.content;
|
||||
mail.date = mailData.date;
|
||||
mail.read = true;
|
||||
mail.level = mailData.level;
|
||||
if(mailData.reward != null)
|
||||
{
|
||||
mail.reward = mailData.reward;
|
||||
}
|
||||
mail.getReward = true;
|
||||
mail.isCollectionMail = true;
|
||||
collectMails.push(mail);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_onLoadCollectComplete != null)
|
||||
{
|
||||
_onLoadCollectComplete();
|
||||
_onLoadCollectComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function saveCollectMails(onComplete:Function = null) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var m:MailVo = null;
|
||||
var obj:Object = null;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < collectMails.length; )
|
||||
{
|
||||
m = collectMails[i];
|
||||
obj = {
|
||||
"id":m.id,
|
||||
"title":m.title,
|
||||
"content":m.content,
|
||||
"date":m.date,
|
||||
"level":m.level,
|
||||
"reward":m.reward
|
||||
};
|
||||
arr.push(obj);
|
||||
i++;
|
||||
}
|
||||
var saveStr:String = Json.encode(arr);
|
||||
NetMiniGame.getIns().saveData("mailCollectList",saveStr,"","",onComplete);
|
||||
}
|
||||
|
||||
public function isMailCollected(mailId:int) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
if(collectMails == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for(i = 0; i < collectMails.length; )
|
||||
{
|
||||
if((collectMails[i] as MailVo).id == mailId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addCollectMail(mail:MailVo, onComplete:Function = null) : void
|
||||
{
|
||||
if(isMailCollected(mail.id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var cMail:MailVo = new MailVo();
|
||||
cMail.id = mail.id;
|
||||
cMail.title = mail.title;
|
||||
cMail.content = mail.content;
|
||||
cMail.date = mail.date;
|
||||
cMail.level = mail.level;
|
||||
cMail.reward = mail.reward;
|
||||
cMail.read = true;
|
||||
cMail.getReward = true;
|
||||
cMail.isCollectionMail = true;
|
||||
collectMails.push(cMail);
|
||||
saveCollectMails(onComplete);
|
||||
}
|
||||
|
||||
public function removeCollectMails(ids:Array, onComplete:Function = null) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var m:MailVo = null;
|
||||
for(i = 0; i < collectMails.length; )
|
||||
{
|
||||
m = collectMails[i];
|
||||
if(ids.indexOf(m.id) != -1)
|
||||
{
|
||||
collectMails.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
saveCollectMails(onComplete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.master.MasterVo;
|
||||
|
||||
public function get Master() : MasterVo
|
||||
{
|
||||
return Game.getIns().master;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,637 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.global;
|
||||
import net.pixvi.common.utils.mobi.MobiTools;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.alchemy.AlchemyStackVo;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.explore.ExploreTeamVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.master.MasterInfoVo;
|
||||
import net.pixvi.myr.element.master.MasterVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.room.RoomVo;
|
||||
import net.pixvi.myr.element.stack.StackVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.element.team.TeamVo;
|
||||
import net.pixvi.myr.element.user.ServerVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetMaster;
|
||||
import net.pixvi.myr.panel.avatar.AvatarVo;
|
||||
import net.pixvi.myr.panel.levelup.LevelUpPanel;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.Oncer;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class MasterCenter extends Singleton
|
||||
{
|
||||
|
||||
public var masterInfo:MasterInfoVo;
|
||||
|
||||
private var onAutoChecklevelUpComplete:Function;
|
||||
|
||||
private var levelUp_para:Object;
|
||||
|
||||
private var autoAddTi_checking:Boolean = false;
|
||||
|
||||
private var onSetAvatarComplete:Function;
|
||||
|
||||
private var setAvatar_buffAvatar:int;
|
||||
|
||||
private var onGetAvatarComplete:Function;
|
||||
|
||||
private var onChangeNameComplete:Function;
|
||||
|
||||
private var changeName_paraName:String = "";
|
||||
|
||||
public function MasterCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : MasterCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(MasterCenter) as MasterCenter;
|
||||
}
|
||||
|
||||
public function loadMasterData(data:Object) : void
|
||||
{
|
||||
var payGiftArr:Array = null;
|
||||
var i8:int = 0;
|
||||
var i:int = 0;
|
||||
var stackData:Object = null;
|
||||
var stack:StackVo = null;
|
||||
var i4:int = 0;
|
||||
var alchemyStackData:Object = null;
|
||||
var alchemyStack:AlchemyStackVo = null;
|
||||
var i7:int = 0;
|
||||
var mb:Object = null;
|
||||
var j:int = 0;
|
||||
var monData:Object = null;
|
||||
var mon:MonsterVo = null;
|
||||
var k:int = 0;
|
||||
var itemData:Object = null;
|
||||
var item:ItemVo = null;
|
||||
var i2:int = 0;
|
||||
var expTeam:ExploreTeamVo = null;
|
||||
var i3:int = 0;
|
||||
var taskData:Object = null;
|
||||
var task:TaskVo = null;
|
||||
var i5:int = 0;
|
||||
var roomData:Object = null;
|
||||
var room:RoomVo = null;
|
||||
var i6:int = 0;
|
||||
var team:TeamVo = null;
|
||||
var roomPos:int = 0;
|
||||
var curServer:ServerVo = null;
|
||||
var m:MasterVo = new MasterVo();
|
||||
m.init();
|
||||
m.id = data.master.id;
|
||||
m.createTime = data.master.createTime;
|
||||
m.level = data.master.level;
|
||||
m.name = data.master.roleName;
|
||||
m.farmName = data.master.farmName;
|
||||
m.avatar = data.master.avatar;
|
||||
m.exp = data.master.exp;
|
||||
m.money = data.master.money;
|
||||
m.ti = data.master.ti;
|
||||
m.ke = data.master.ke;
|
||||
m.curBattleTeam = "teamA";
|
||||
m.timeTi = data.master.timeTi / 1000;
|
||||
if(MobiTools.isMobi())
|
||||
{
|
||||
if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
MyrAne.notifyZone("1000","bilibili区",m.id.toString(),m.name);
|
||||
}
|
||||
}
|
||||
GameCenter.getIns().inGameDay = Calendar.getDayNumber();
|
||||
m.history.loadHistoryData(data.history,data.data2);
|
||||
if(data.payInfo != null)
|
||||
{
|
||||
if(data.payInfo.payGiftTypes == null)
|
||||
{
|
||||
data.payInfo.payGiftTypes = data.payInfo.payGitfTypes;
|
||||
}
|
||||
m.history.payPoint = data.payInfo.payPoint;
|
||||
if(data.payInfo.payGiftTypes != null)
|
||||
{
|
||||
payGiftArr = data.payInfo.payGiftTypes.split(",");
|
||||
for(i8 = 0; i8 < payGiftArr.length; )
|
||||
{
|
||||
m.history.payGiftTypes[payGiftArr[i8]] = true;
|
||||
i8++;
|
||||
}
|
||||
}
|
||||
}
|
||||
m.activityHistory.loadActivityData(data.activityHistory);
|
||||
m.vipTime = data.activityHistory.vipInfo.vipTime;
|
||||
m.globalAdd.update(data.master);
|
||||
if(data.masterEventTimer != null)
|
||||
{
|
||||
m.randomEventTimer = data.masterEventTimer;
|
||||
}
|
||||
if(data.masterCurrentEvent != null)
|
||||
{
|
||||
m.randomEvent = data.masterCurrentEvent;
|
||||
}
|
||||
if(m.history.guide_record[GSub.FIRST_OUT] == null)
|
||||
{
|
||||
m.curCityId = 0;
|
||||
}
|
||||
for(i = 0; i < data.stacks.length; )
|
||||
{
|
||||
stackData = data.stacks[i];
|
||||
stack = StackCenter.getStackByStackData(stackData);
|
||||
m.stacks.push(stack);
|
||||
i++;
|
||||
}
|
||||
for(i4 = 0; i4 < data.alchemyStacks.length; )
|
||||
{
|
||||
alchemyStackData = data.alchemyStacks[i4];
|
||||
alchemyStack = AlchemyCenter.getAlchemyStackByAlchemyStackData(alchemyStackData);
|
||||
m.alchemyStacks.push(alchemyStack);
|
||||
i4++;
|
||||
}
|
||||
var allMbs:Object = {};
|
||||
if(data.monsterAttributes != null)
|
||||
{
|
||||
for(i7 = 0; i7 < data.monsterAttributes.length; )
|
||||
{
|
||||
mb = data.monsterAttributes[i7];
|
||||
allMbs[mb.monsterId] = mb;
|
||||
i7++;
|
||||
}
|
||||
}
|
||||
for(j = 0; j < data.monsters.length; )
|
||||
{
|
||||
monData = data.monsters[j];
|
||||
mon = MonsterCenter.getMonByMonData(monData);
|
||||
m.monsters.push(mon);
|
||||
if(allMbs[mon.id] != null)
|
||||
{
|
||||
mon.abilityAdd.update(allMbs[mon.id]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
for(k = 0; k < data.items.length; )
|
||||
{
|
||||
itemData = data.items[k];
|
||||
item = BagCenter.getItemByItemData(itemData);
|
||||
m.bag.items.push(item);
|
||||
k++;
|
||||
}
|
||||
for(i2 = 0; i2 < data.exploreTeams.length; )
|
||||
{
|
||||
expTeam = ExploreCenter.makeTeamByData(data.exploreTeams[i2]);
|
||||
m.exploreTeams.push(expTeam);
|
||||
i2++;
|
||||
}
|
||||
for(i3 = 0; i3 < data.currentTasks.length; )
|
||||
{
|
||||
taskData = data.currentTasks[i3];
|
||||
if(taskData == null || Table.task_info[taskData.typeId] == null)
|
||||
{
|
||||
if(taskData != null)
|
||||
{
|
||||
trace("找不到任务:" + taskData.typeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
task = TaskCenter.getTaskByTaskData(taskData);
|
||||
m.tasks.push(task);
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
for(i5 = 0; i5 < data.rooms.length; )
|
||||
{
|
||||
roomData = data.rooms[i5];
|
||||
room = RoomCenter.getRoomByRoomData(roomData);
|
||||
m.rooms.push(room);
|
||||
i5++;
|
||||
}
|
||||
for(i6 = 0; i6 < data.teams.length; )
|
||||
{
|
||||
team = TeamCenter.getTeamVoByData(data.teams[i6]);
|
||||
m.teams[i6] = team;
|
||||
i6++;
|
||||
}
|
||||
Game.getIns().master = m;
|
||||
if(Saver.getAuto(Master.id + "city") != null)
|
||||
{
|
||||
Master.curCityId = int(Saver.getAuto(Master.id + "city"));
|
||||
}
|
||||
if(Saver.getAuto(Master.id + "battleTeam") != null)
|
||||
{
|
||||
Master.curBattleTeam = Saver.getAuto(Master.id + "battleTeam").toString();
|
||||
}
|
||||
if(Saver.getAuto(Master.id + "roomSort") != null)
|
||||
{
|
||||
Master.roomSort = Saver.getAuto(Master.id + "roomSort");
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.roomSort = {};
|
||||
}
|
||||
roomPos = 0;
|
||||
while(roomPos < Master.rooms.length)
|
||||
{
|
||||
if(Master.roomSort[roomPos.toString()] != null)
|
||||
{
|
||||
Master.rooms[roomPos].sort = Master.roomSort[roomPos.toString()];
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.rooms[roomPos].sort = roomPos;
|
||||
}
|
||||
roomPos++;
|
||||
}
|
||||
TaskCenter.getIns().checkReceivableTask();
|
||||
AchiCenter.getIns().checkLocalAchiList();
|
||||
if(MobiTools.isMobi() && MyrCenter.channel == "MEIZU" && Boolean(MyrAne.meizu2Bingxue))
|
||||
{
|
||||
curServer = AccountCenter.getIns().curServer;
|
||||
MyrAne.bingxueSetRoleData(3,curServer.serverId,curServer.serverName,curServer.masterId.toString(),curServer.masterName,Master.level.toString(),Master.money,"驯养师","","牧羊人之心");
|
||||
}
|
||||
}
|
||||
|
||||
public function autoCheckLevelUp(show:Boolean = true, onComplete:* = null) : void
|
||||
{
|
||||
onAutoChecklevelUpComplete = onComplete;
|
||||
var oldLevel:int = int(Master.level);
|
||||
var newLevel:int = oldLevel;
|
||||
while(newLevel + 1 <= GameMath.masterMaxLevel && Master.exp >= Table.farm_level[newLevel + 1])
|
||||
{
|
||||
newLevel += 1;
|
||||
}
|
||||
if(newLevel > oldLevel)
|
||||
{
|
||||
levelUp(show);
|
||||
}
|
||||
else if(onAutoChecklevelUpComplete != null)
|
||||
{
|
||||
onAutoChecklevelUpComplete();
|
||||
onAutoChecklevelUpComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function levelUp(show:Boolean = true) : void
|
||||
{
|
||||
levelUp_para = {"show":show};
|
||||
NetMaster.getIns().checkLevel(levelUpHandler);
|
||||
}
|
||||
|
||||
private function levelUpHandler(newLevel:int) : void
|
||||
{
|
||||
Master.level = newLevel;
|
||||
if(levelUp_para.show)
|
||||
{
|
||||
if(onAutoChecklevelUpComplete != null)
|
||||
{
|
||||
LevelUpPanel.getIns().onComplete = onAutoChecklevelUpComplete;
|
||||
onAutoChecklevelUpComplete = null;
|
||||
}
|
||||
Caller.delayCall(LevelUpPanel.getIns().popIn,100);
|
||||
}
|
||||
sendNumChangeEvent();
|
||||
levelUp_para = null;
|
||||
if(MyrCenter.channel == "MEIZU" && MobiTools.isMobi())
|
||||
{
|
||||
if(MyrAne.meizu2Bingxue)
|
||||
{
|
||||
MyrAne.bingxueSetRoleData(4,AccountCenter.getIns().curServer.serverId,AccountCenter.getIns().curServer.serverName,Master.id.toString(),Master.name,Master.level.toString(),Master.money,"驯养师","","牧羊人之心");
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.meizuSetRoleData(3,(int(Master.createTime / 1000)).toString(),Master.id.toString(),Master.name,Master.level.toString(),"0","0",AccountCenter.getIns().curServer.serverId.toString(),AccountCenter.getIns().curServer.serverName);
|
||||
}
|
||||
}
|
||||
if(onAutoChecklevelUpComplete != null)
|
||||
{
|
||||
onAutoChecklevelUpComplete();
|
||||
onAutoChecklevelUpComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function addExp(exp:int, show:Boolean = false) : void
|
||||
{
|
||||
if(exp > 0)
|
||||
{
|
||||
Master.exp += exp;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("获得了 {0} 牧场经验!",CP.exp(exp.toString())));
|
||||
}
|
||||
Oncer.lastRun(sendNumChangeEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public function addMoney(money:int, show:Boolean = false) : void
|
||||
{
|
||||
if(money > 0)
|
||||
{
|
||||
Master.money += money;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("获得了 {0} 金币!",CP.money(money.toString())));
|
||||
}
|
||||
Master.history.numAddMoney += money;
|
||||
AchiCenter.getIns().autoCheck(AchiType.MONEY);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(money >= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Master.money += money;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("失去了 {0} 金币。",CP.money(Math.abs(money).toString())));
|
||||
}
|
||||
}
|
||||
Oncer.lastRun(sendNumChangeEvent);
|
||||
}
|
||||
|
||||
public function addKe(ke:int, show:Boolean = false) : void
|
||||
{
|
||||
if(ke > 0)
|
||||
{
|
||||
Master.ke += ke;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("获得了 {0} 氪金!",CP.ke(ke.toString())));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ke >= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Master.ke += ke;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("失去了 {0} 氪金。",CP.ke(Math.abs(ke).toString())));
|
||||
}
|
||||
}
|
||||
Oncer.lastRun(sendNumChangeEvent);
|
||||
}
|
||||
|
||||
public function addTi(ti:int, show:Boolean = false, modeTime:Boolean = false) : void
|
||||
{
|
||||
if(ti > 0)
|
||||
{
|
||||
if(modeTime)
|
||||
{
|
||||
if(Master.ti >= Master.tiMax)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Master.ti += ti;
|
||||
if(Master.ti > Master.tiMax)
|
||||
{
|
||||
Master.ti = Master.tiMax;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.ti += ti;
|
||||
if(Master.ti > 999)
|
||||
{
|
||||
Master.ti = 999;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ti >= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Master.ti += ti;
|
||||
if(Master.ti < 0)
|
||||
{
|
||||
Master.ti = 0;
|
||||
}
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("失去了 {0} 点体力。",CP.ti(Math.abs(ti).toString())));
|
||||
}
|
||||
}
|
||||
Oncer.lastRun(sendNumChangeEvent);
|
||||
}
|
||||
|
||||
public function autoAddTi() : void
|
||||
{
|
||||
if(autoAddTi_checking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
autoAddTi_checking = true;
|
||||
var ct:int = ClockDriver.timestamp - Master.timeTi;
|
||||
var num:int = int(ct / GameMath.tiCD);
|
||||
if(num > 0)
|
||||
{
|
||||
NetMaster.getIns().checkTi(autoAddTiHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
autoAddTi_checking = false;
|
||||
}
|
||||
}
|
||||
|
||||
private function autoAddTiHandler(newTi:int, newTimeTi:uint) : void
|
||||
{
|
||||
if(newTi == Master.ti)
|
||||
{
|
||||
Master.timeTi = newTimeTi;
|
||||
Caller.delayCall(delaySetTiChecking,3000,1);
|
||||
return;
|
||||
}
|
||||
MasterCenter.getIns().addTi(newTi - Master.ti,false,true);
|
||||
Master.timeTi = newTimeTi;
|
||||
autoAddTi_checking = false;
|
||||
}
|
||||
|
||||
private function delaySetTiChecking() : void
|
||||
{
|
||||
autoAddTi_checking = false;
|
||||
autoAddTi();
|
||||
}
|
||||
|
||||
public function inJectGAoPara() : void
|
||||
{
|
||||
global.gn.myName = Master.name;
|
||||
global.gn.farmName = Master.farmName;
|
||||
}
|
||||
|
||||
public function sendNumChangeEvent() : void
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new Event(MYREvent.ROLE_NUM_CHANGE));
|
||||
}
|
||||
|
||||
public function getCurZL() : int
|
||||
{
|
||||
var arr:Array = TeamCenter.getIns().getFightStackMonsters(Master.curBattleTeam);
|
||||
var zl:int = 0;
|
||||
for each(var m:MonsterVo in arr)
|
||||
{
|
||||
zl += GameMath.zl_monVo(m);
|
||||
}
|
||||
return zl;
|
||||
}
|
||||
|
||||
public function getVipDay() : int
|
||||
{
|
||||
if(TimeCenter.timestamp < Master.vipTime)
|
||||
{
|
||||
return Calendar.getDayNumber(Master.vipTime) - Calendar.getDayNumber();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getVipChecked() : Boolean
|
||||
{
|
||||
var checkDay:int = Calendar.getDayNumber(Master.activityHistory.vipCheckTime);
|
||||
var curDay:int = Calendar.getDayNumber();
|
||||
if(checkDay != curDay)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function goCity(city:int) : void
|
||||
{
|
||||
Master.curCityId = city;
|
||||
if(!GuideCenter.getIns().checkFin(GSub.FIRST_OUT))
|
||||
{
|
||||
GuideCenter.getIns().fin(GSub.FIRST_OUT);
|
||||
}
|
||||
Saver.saveAuto(Master.id + "city",city);
|
||||
}
|
||||
|
||||
public function setAvatar(avatar:int, onComplete:Function) : void
|
||||
{
|
||||
onSetAvatarComplete = onComplete;
|
||||
setAvatar_buffAvatar = avatar;
|
||||
NetMaster.getIns().setAvatar(avatar,setAvatarComplete);
|
||||
}
|
||||
|
||||
private function setAvatarComplete() : void
|
||||
{
|
||||
Master.avatar = setAvatar_buffAvatar;
|
||||
if(onSetAvatarComplete != null)
|
||||
{
|
||||
onSetAvatarComplete();
|
||||
onSetAvatarComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getUseableAvatar() : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var avo:AvatarVo = null;
|
||||
var avatars:Array = [];
|
||||
for(i = 0; i < Table.avatar_infoArr.length; )
|
||||
{
|
||||
avo = new AvatarVo();
|
||||
avo.avatarId = Table.avatar_infoArr[i].avatarId;
|
||||
trace(Table.avatar_infoArr[i].avatarId);
|
||||
if(avo.useable())
|
||||
{
|
||||
if(Master.newAvatars != null && Master.newAvatars.indexOf(avo.avatarId.toString()) != -1)
|
||||
{
|
||||
avatars.insertAt(0,avo);
|
||||
}
|
||||
else
|
||||
{
|
||||
avatars.push(avo);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return avatars;
|
||||
}
|
||||
|
||||
public function getAvatar(onComplete:Function) : void
|
||||
{
|
||||
if(Master.avatars != null)
|
||||
{
|
||||
onComplete();
|
||||
return;
|
||||
}
|
||||
onGetAvatarComplete = onComplete;
|
||||
NetMaster.getIns().getAvatar(getAvatarComplete);
|
||||
}
|
||||
|
||||
private function getAvatarComplete(avatars:Array) : void
|
||||
{
|
||||
Master.avatars = avatars;
|
||||
if(onGetAvatarComplete != null)
|
||||
{
|
||||
onGetAvatarComplete();
|
||||
onGetAvatarComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function changeName(newName:String, onComplete:Function) : void
|
||||
{
|
||||
onChangeNameComplete = onComplete;
|
||||
changeName_paraName = newName;
|
||||
NetMaster.getIns().changeName(newName,changeNameHandler);
|
||||
}
|
||||
|
||||
public function changeNameHandler(re:Object) : void
|
||||
{
|
||||
var costItemVo:ItemVo = null;
|
||||
var success:Boolean = false;
|
||||
if(re.resCode == 801)
|
||||
{
|
||||
Alert.yes(lang("哎呀"),lang("名称【{0}】已被使用,换个名字吧!",changeName_paraName));
|
||||
}
|
||||
else if(re.resCode == 0)
|
||||
{
|
||||
success = true;
|
||||
costItemVo = BagCenter.getIns().subNumByType(Table.game_setting.changeNameItemId,1,true,lang("使用了{0} 个 {1}"));
|
||||
Alert.yes(lang("提示"),lang("角色名已更改为【{0}】!",changeName_paraName));
|
||||
Master.name = changeName_paraName;
|
||||
MainMenu.getIns().ui.ui_top.text_name.text = changeName_paraName;
|
||||
masterInfo.roleName = Master.name;
|
||||
global.gn.myName = Master.name;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,costItemVo));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.yes(lang("更改失败"),"code:" + re.resCode);
|
||||
}
|
||||
if(onChangeNameComplete != null)
|
||||
{
|
||||
onChangeNameComplete(success);
|
||||
onChangeNameComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getSortedRoomArray() : Array
|
||||
{
|
||||
var soroom:Array = Master.rooms.concat();
|
||||
soroom.sortOn("sort",16);
|
||||
return soroom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.net.NetMiniGame;
|
||||
import net.pixvi.myr.panel.gameroom.MiniGameVo;
|
||||
import net.pixvi.myr.panel.minigame.BaseMiniGame;
|
||||
import net.pixvi.myr.panel.minigame.minigame1.MiniGame1_Runner;
|
||||
import net.pixvi.myr.panel.minigame.minigame2.MiniGame2_MoleHitter;
|
||||
import net.pixvi.myr.panel.minigame.minigame3.MiniGame3_SlimCombiner;
|
||||
import net.pixvi.myr.panel.minigame.minigame4.MiniGame4_WCCommander;
|
||||
import net.pixvi.myr.panel.minigame.minigame5.MiniGame5_TaoDaE;
|
||||
import net.pixvi.myr.panel.minigame.minigame6.MiniGame6_BrickHero;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.utils.Saver;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class MiniGameCenter
|
||||
{
|
||||
|
||||
public var gameRecords:Object;
|
||||
|
||||
private var onMiniGameStartComplete:Function;
|
||||
|
||||
private var onMiniGameStart_vo:MiniGameVo;
|
||||
|
||||
private var onMiniGameOverComplete:Function;
|
||||
|
||||
private var onMiniGameOver_id:int;
|
||||
|
||||
private var onMiniGameOver_point:int;
|
||||
|
||||
private var onGetRecordComplete:Function;
|
||||
|
||||
public function MiniGameCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : MiniGameCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(MiniGameCenter) as MiniGameCenter;
|
||||
}
|
||||
|
||||
public function miniGameStart(id:int, onComplete:Function) : void
|
||||
{
|
||||
onMiniGameStartComplete = onComplete;
|
||||
var gamevo:MiniGameVo = new MiniGameVo();
|
||||
gamevo.typeId = id;
|
||||
onMiniGameStart_vo = gamevo;
|
||||
NetMiniGame.getIns().miniGameStart(onMiniGameStart_vo.type,miniGameStartHandler);
|
||||
}
|
||||
|
||||
public function miniGameStartHandler(re:Object = null) : void
|
||||
{
|
||||
BagCenter.getIns().subNumByType(int(onMiniGameStart_vo.coinType),onMiniGameStart_vo.coin,true,"",true);
|
||||
if(onMiniGameStartComplete != null)
|
||||
{
|
||||
onMiniGameStartComplete();
|
||||
onMiniGameStartComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function miniGameOver(id:int, point:int, onComplete:Function) : void
|
||||
{
|
||||
onMiniGameOverComplete = onComplete;
|
||||
onMiniGameOver_id = id;
|
||||
onMiniGameOver_point = point;
|
||||
NetMiniGame.getIns().miniGameOver(point,miniGameOverHandler);
|
||||
}
|
||||
|
||||
private function miniGameOverHandler(re:Object = null) : void
|
||||
{
|
||||
var vo:MiniGameVo = new MiniGameVo();
|
||||
vo.typeId = onMiniGameOver_id;
|
||||
if(gameRecords[onMiniGameOver_id.toString()] == null)
|
||||
{
|
||||
gameRecords[onMiniGameOver_id.toString()] = {
|
||||
"type":vo.type,
|
||||
"maxScore":onMiniGameOver_point,
|
||||
"num":0
|
||||
};
|
||||
}
|
||||
if(re.newRecord == true)
|
||||
{
|
||||
Alert.showMsg(lang("创造了新的个人记录!"));
|
||||
gameRecords[onMiniGameOver_id.toString()].maxScore = onMiniGameOver_point;
|
||||
}
|
||||
gameRecords[onMiniGameOver_id.toString()].num++;
|
||||
var itemvo:ItemVo = new ItemVo();
|
||||
itemvo.id = re.itemId;
|
||||
itemvo.num = re.num;
|
||||
var gamevovo:MiniGameVo = new MiniGameVo();
|
||||
gamevovo.typeId = onMiniGameOver_id;
|
||||
itemvo.type = gamevovo.ticketType;
|
||||
BagCenter.getIns().addItem(itemvo);
|
||||
var rewardre:RewardResultVo = new RewardResultVo();
|
||||
RewardShowPanel.show([itemvo],minigameOverRewardshowHandler);
|
||||
if(onMiniGameOverComplete != null)
|
||||
{
|
||||
onMiniGameOverComplete(re);
|
||||
onMiniGameOverComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function minigameOverRewardshowHandler(e:Event = null) : void
|
||||
{
|
||||
PopCenter.getIns().setMaskAlpha();
|
||||
}
|
||||
|
||||
public function getRecord(onComplete:Function) : void
|
||||
{
|
||||
onGetRecordComplete = onComplete;
|
||||
NetMiniGame.getIns().getRecord(getRecordHandler);
|
||||
}
|
||||
|
||||
private function getRecordHandler(re:Object = null) : void
|
||||
{
|
||||
if(re.gameRecords == null)
|
||||
{
|
||||
gameRecords = {};
|
||||
}
|
||||
else
|
||||
{
|
||||
gameRecords = {};
|
||||
for each(var o:Object in re.gameRecords)
|
||||
{
|
||||
gameRecords[Table.mini_game[o.type].typeId] = o;
|
||||
}
|
||||
}
|
||||
if(onGetRecordComplete != null)
|
||||
{
|
||||
onGetRecordComplete(re);
|
||||
onGetRecordComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getMiniGame(gameType:int) : BaseMiniGame
|
||||
{
|
||||
var game:BaseMiniGame = null;
|
||||
switch(gameType - 1)
|
||||
{
|
||||
case 0:
|
||||
game = new MiniGame1_Runner();
|
||||
break;
|
||||
case 1:
|
||||
game = new MiniGame2_MoleHitter();
|
||||
break;
|
||||
case 2:
|
||||
game = new MiniGame3_SlimCombiner();
|
||||
break;
|
||||
case 3:
|
||||
game = new MiniGame4_WCCommander();
|
||||
break;
|
||||
case 4:
|
||||
game = new MiniGame5_TaoDaE();
|
||||
break;
|
||||
case 5:
|
||||
game = new MiniGame6_BrickHero();
|
||||
}
|
||||
return game;
|
||||
}
|
||||
|
||||
public function getRecordScore(gameType:int) : int
|
||||
{
|
||||
var vo:MiniGameVo = new MiniGameVo();
|
||||
vo.typeId = gameType;
|
||||
return vo.topPoint;
|
||||
}
|
||||
|
||||
public function saveLocalRecordScore(gameType:int, score:int) : void
|
||||
{
|
||||
var masterId:int = 0;
|
||||
if(Master == null)
|
||||
{
|
||||
masterId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
masterId = int(Master.id);
|
||||
}
|
||||
Saver.saveAuto(masterId + "_game" + gameType,score);
|
||||
}
|
||||
|
||||
public function getLocalRecordScore(gameType:int) : int
|
||||
{
|
||||
var masterId:int = 0;
|
||||
if(Master == null)
|
||||
{
|
||||
masterId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
masterId = int(Master.id);
|
||||
}
|
||||
var re:Object = Saver.getAuto(masterId + "game" + gameType);
|
||||
if(re == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return int(re);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,452 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.center.PopCenter;
|
||||
import net.pixvi.common.system.AppLayer;
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.net.NetPay;
|
||||
import net.pixvi.myr.net.NetPayPoint;
|
||||
import net.pixvi.myrane.MyrAne;
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
import net.pixvi.pfw.utils.Calendar;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
import net.pixvi.psg.ui.PSGWaitingPanel;
|
||||
|
||||
public class PayCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onBuyGoodSuccess:Function;
|
||||
|
||||
private var onBuyGoodFail:Function;
|
||||
|
||||
private var buyGood_tradeId:String;
|
||||
|
||||
private var buyGood_goodId:int;
|
||||
|
||||
private var vipCardId:Number;
|
||||
|
||||
private var onPayPointRewardComplete:Function;
|
||||
|
||||
private var payPointReward_giftTypeId:String;
|
||||
|
||||
public function PayCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : PayCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PayCenter) as PayCenter;
|
||||
}
|
||||
|
||||
public function buyGood(goodId:int, onSuccess:Function, onFail:Function) : void
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("准备购买goodId:" + goodId);
|
||||
}
|
||||
onBuyGoodSuccess = onSuccess;
|
||||
onBuyGoodFail = onFail;
|
||||
buyGood_goodId = goodId;
|
||||
if(AccountCenter.getIns().isVisitor && Table.setting.open_visitorPay == false && MyrCenter.lang != "JP")
|
||||
{
|
||||
if(MyrCenter.platform == "IOS")
|
||||
{
|
||||
onBuyGoodFail("游客状态无法购买商品,请绑定账号后再操作吧!");
|
||||
}
|
||||
else
|
||||
{
|
||||
onBuyGoodFail("游客状态无法购买商品,请先完成账号绑定并重启游戏。");
|
||||
}
|
||||
return;
|
||||
}
|
||||
PSGWaitingPanel.getIns().setPanel(lang("购买中..."));
|
||||
PopCenter.POP(PSGWaitingPanel.getIns());
|
||||
if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
Caller.delayCall(meizuCloseWaitPanel,20000);
|
||||
}
|
||||
NetPay.getIns().getTradeId(goodId,getTradeIdHandler);
|
||||
}
|
||||
|
||||
private function meizuCloseWaitPanel() : void
|
||||
{
|
||||
if(PSGWaitingPanel.getIns().showing)
|
||||
{
|
||||
PSGWaitingPanel.getIns().showOut();
|
||||
}
|
||||
}
|
||||
|
||||
private function getTradeIdHandler(resCode:int, resMsg:String, tradeId:String, blblOrderSign:String, resPara:Object = null) : void
|
||||
{
|
||||
var goodInfo:Object = null;
|
||||
var nameAndDes:String = null;
|
||||
var ext:Object = null;
|
||||
trace("[支付流程]获取交易号成功");
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]获取交易号成功。");
|
||||
}
|
||||
if(resCode == 996)
|
||||
{
|
||||
if(MyrCenter.hasLang())
|
||||
{
|
||||
onBuyGoodFail(resMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
onBuyGoodFail(lang("获取交易号失败!err:{0}",resCode.toString()));
|
||||
}
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]获取交易号失败。");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]调起SDK支付。");
|
||||
}
|
||||
buyGood_tradeId = tradeId;
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]获得tracdeId:" + tradeId);
|
||||
}
|
||||
goodInfo = Table.pay_info[buyGood_goodId];
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]buyGoodId:" + buyGood_goodId);
|
||||
AppLayer.app.trace("[支付流程]buyGoodInfo:" + Json.encode(goodInfo));
|
||||
AppLayer.app.trace("[支付流程]buyGoodChannel:" + MyrCenter.channel);
|
||||
}
|
||||
if(MyrCenter.channel == "BLBL")
|
||||
{
|
||||
MyrAne.payBlbl(tradeId,goodInfo.name,goodInfo.name,goodInfo.rmb,"1000",goodInfo.payPoint * 10,"","",blblOrderSign,AccountCenter.getIns().sdkUserId,Master.name,Master.name,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
else if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]goodInfoName:" + goodInfo.name);
|
||||
}
|
||||
nameAndDes = goodInfo.name;
|
||||
if(Table.channel_tag == null)
|
||||
{
|
||||
Table.channel_tag = {"channelTag":"none"};
|
||||
}
|
||||
if(nameAndDes.length > 5 && Table.channel_tag.channelTag == "vivo")
|
||||
{
|
||||
nameAndDes = nameAndDes.substr(0,5);
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("vivo渠道");
|
||||
}
|
||||
}
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]bingxue:" + MyrAne.meizu2Bingxue);
|
||||
}
|
||||
if(MyrAne.meizu2Bingxue)
|
||||
{
|
||||
ext = {"payOrderNo":tradeId};
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("[支付流程]调用sdk最后一步extData:payOrderNo" + tradeId);
|
||||
}
|
||||
MyrAne.bingxuePay(1,1,Json.encode(ext),goodInfo.rmb / 100,goodInfo.id.toString(),nameAndDes,nameAndDes,Master.id.toString(),Master.level,Master.name,AccountCenter.getIns().curServer.serverId.toString(),AccountCenter.getIns().curServer.serverName,MasterCenter.getIns().getVipDay() > 0 ? "1" : "0",tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.payMeizu(tradeId,goodInfo.id,nameAndDes,nameAndDes,goodInfo.rmb.toString(),AccountCenter.getIns().curServer.serverId.toString(),"",Master.id.toString(),Master.name,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
}
|
||||
else if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
if(MyrCenter.platform == "IOS")
|
||||
{
|
||||
MyrAne.iosPayXD(goodInfo.xdid,1,AccountCenter.getIns().curServer.JPserverId.toString(),"{\"payOrderNo\":\"" + tradeId + "\"}",Master.level,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.payXD(goodInfo.xdid,AccountCenter.getIns().curServer.JPserverId.toString(),"{\"payOrderNo\":\"" + tradeId + "\"}",Master.level,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
}
|
||||
else if(MyrCenter.channel == "CPG")
|
||||
{
|
||||
trace("A");
|
||||
MyrAne.payCpg(resPara.orderID,resPara.productname,resPara.money,resPara.productcode,resPara.time,resPara.sign,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
else if(MyrCenter.platform == "IOS")
|
||||
{
|
||||
MyrAne.payDydIos(goodInfo.iid,tradeId,goodInfo.name,goodInfo.rmb,1,tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyrAne.payDyd(tradeId,goodInfo.name,goodInfo.rmb,1,goodInfo.rmb,"无折扣",tradeSuccessHandler,tradeFailHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function meizuDelayFail() : void
|
||||
{
|
||||
Caller.delayCall(meizuDelayFail2,2800);
|
||||
}
|
||||
|
||||
public function meizuDelayFail2() : void
|
||||
{
|
||||
PSGWaitingPanel.getIns().showOut();
|
||||
Caller.stopCall(meizuCloseWaitPanel,20000);
|
||||
onBuyGoodFail(lang("付款失败!若已成功扣款,请尝试重新登录游戏并返回该界面领取奖励。"));
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
}
|
||||
|
||||
private function tradeFailHandler() : void
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("SDK支付失败回调。");
|
||||
}
|
||||
if(MyrCenter.channel == "MEIZU")
|
||||
{
|
||||
meizuDelayFail();
|
||||
return;
|
||||
}
|
||||
PSGWaitingPanel.getIns().showOut();
|
||||
Caller.stopCall(meizuCloseWaitPanel,20000);
|
||||
onBuyGoodFail(lang("付款失败!若已成功扣款,请尝试重新登录游戏并返回该界面领取奖励。"));
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
}
|
||||
|
||||
private function tradeSuccessHandler(sdk_trade_no:Object = null) : void
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
AppLayer.app.trace("支付成功");
|
||||
}
|
||||
trace("支付成功");
|
||||
Caller.stopCall(meizuDelayFail2,2800);
|
||||
if(sdk_trade_no == null)
|
||||
{
|
||||
sdk_trade_no = "";
|
||||
}
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.yes(lang("支付成功"),lang("点击确定领取奖励。"),traceConfirm);
|
||||
}
|
||||
else
|
||||
{
|
||||
NetPay.getIns().getTradeReward(buyGood_tradeId,sdk_trade_no.toString(),getTradeRewardHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function traceConfirm() : void
|
||||
{
|
||||
NetPay.getIns().getTradeReward(buyGood_tradeId,buyGood_tradeId,getTradeRewardHandler);
|
||||
}
|
||||
|
||||
private function getTradeRewardHandler(rewardData:Object, resMsg:String, resCode:String = "0") : void
|
||||
{
|
||||
var guidelib:Object = null;
|
||||
var vo:RewardResultVo = null;
|
||||
PSGWaitingPanel.getIns().showOut();
|
||||
Caller.stopCall(meizuCloseWaitPanel,20000);
|
||||
if(resCode == "990")
|
||||
{
|
||||
if(MyrCenter.hasLang())
|
||||
{
|
||||
onBuyGoodFail(lang("获取奖励失败!{0}",resCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
onBuyGoodFail(resMsg);
|
||||
}
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
return;
|
||||
}
|
||||
if(rewardData != null)
|
||||
{
|
||||
if(Master.history.payTypeCount[buyGood_goodId] == null)
|
||||
{
|
||||
Master.history.payTypeCount[buyGood_goodId] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.payTypeCount[buyGood_goodId]++;
|
||||
}
|
||||
if(Master.history.payTypeDayCount[buyGood_goodId] == null)
|
||||
{
|
||||
Master.history.payTypeDayCount[buyGood_goodId] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.payTypeDayCount[buyGood_goodId]++;
|
||||
}
|
||||
Master.history.payPoint += Table.pay_info[buyGood_goodId].payPoint;
|
||||
if(MyrCenter.channel == "XDG")
|
||||
{
|
||||
guidelib = {
|
||||
"charge6":6,
|
||||
"charge60":60,
|
||||
"charge600":600,
|
||||
"charge3000":3000,
|
||||
"charge6000":6000,
|
||||
"charge7500":7500
|
||||
};
|
||||
for(var key:String in guidelib)
|
||||
{
|
||||
if(Master.history.payPoint >= guidelib[key] && !GuideCenter.getIns().checkFin(key))
|
||||
{
|
||||
GuideCenter.getIns().fin(key);
|
||||
MyrAne.track(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(GameMath.isVipGood(buyGood_goodId.toString()))
|
||||
{
|
||||
vo = RewardCenter.getIns().getRewardByData(rewardData,true,"panel",onBuyVipCardHandler);
|
||||
vipCardId = vo.items[0].id;
|
||||
}
|
||||
else
|
||||
{
|
||||
RewardCenter.getIns().getRewardByData(rewardData,true,"panel",onBuyGoodSuccess);
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MyrCenter.hasLang())
|
||||
{
|
||||
onBuyGoodFail(lang("获取奖励失败!{0}",resCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
onBuyGoodFail(resMsg);
|
||||
}
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function onBuyVipCardHandler() : void
|
||||
{
|
||||
onBuyGoodSuccess();
|
||||
onBuyGoodSuccess = null;
|
||||
onBuyGoodFail = null;
|
||||
BagCenter.getIns().useItem(vipCardId,1,null);
|
||||
}
|
||||
|
||||
public function checkBuyAble(goodId:String) : Boolean
|
||||
{
|
||||
var canBuy:Boolean = true;
|
||||
var buynum:int = 0;
|
||||
var buyDayNum:int = 0;
|
||||
if(Master.history.payTypeCount[goodId] != null)
|
||||
{
|
||||
buynum = int(Master.history.payTypeCount[goodId]);
|
||||
}
|
||||
if(Master.history.payTypeDayCount[goodId] != null)
|
||||
{
|
||||
buyDayNum = int(Master.history.payTypeDayCount[goodId]);
|
||||
}
|
||||
if(Table.pay_info[goodId].num != -1 && Table.pay_info[goodId].num <= buynum)
|
||||
{
|
||||
canBuy = false;
|
||||
}
|
||||
if(Table.pay_info[goodId].dayNum != -1 && Table.pay_info[goodId].dayNum <= buyDayNum)
|
||||
{
|
||||
canBuy = false;
|
||||
}
|
||||
return canBuy;
|
||||
}
|
||||
|
||||
public function payPointReward(giftTypeId:String, onComplete:Function) : void
|
||||
{
|
||||
onPayPointRewardComplete = onComplete;
|
||||
payPointReward_giftTypeId = giftTypeId;
|
||||
NetPayPoint.getIns().payPointReward(giftTypeId,payPointRewardHandler);
|
||||
}
|
||||
|
||||
private function payPointRewardHandler(rewardData:Object) : void
|
||||
{
|
||||
var rewardResultVo:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
RewardCenter.getIns().getReward(rewardResultVo);
|
||||
Master.history.payGiftTypes[payPointReward_giftTypeId] = true;
|
||||
if(onPayPointRewardComplete != null)
|
||||
{
|
||||
onPayPointRewardComplete(rewardResultVo);
|
||||
onPayPointRewardComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkPayGiftCanGet(giftId:String) : Boolean
|
||||
{
|
||||
if(Master.history.payGiftTypes[giftId] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getGoodBuyNum(goodId:String) : int
|
||||
{
|
||||
if(Master.history.payTypeCount[goodId] == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return Master.history.payTypeCount[goodId];
|
||||
}
|
||||
|
||||
public function getGoodDayBuyNum(goodId:String) : int
|
||||
{
|
||||
var dayBuyNum:int = 0;
|
||||
if(Master.history.payTypeDayCount[goodId] != null)
|
||||
{
|
||||
dayBuyNum = int(Master.history.payTypeDayCount[goodId]);
|
||||
}
|
||||
return dayBuyNum;
|
||||
}
|
||||
|
||||
public function checkItemTime(id:String) : Boolean
|
||||
{
|
||||
var createDay:int = 0;
|
||||
var curDay:int = 0;
|
||||
var payData:Object = Table.pay_info[id];
|
||||
var time:Date = new Date();
|
||||
time.setTime(TimeCenter.timestamp * 1000);
|
||||
if(payData.month != null)
|
||||
{
|
||||
if(payData.month != time.month + 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(payData.day != null)
|
||||
{
|
||||
if(payData.day != int(time.date))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(payData.beforeDay != null)
|
||||
{
|
||||
createDay = Calendar.getDayNumber(Master.createTime);
|
||||
curDay = Calendar.getDayNumber();
|
||||
if(curDay - createDay > payData.beforeDay)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.npc.PositionNPC;
|
||||
import net.pixvi.myr.element.randomevent.RandomEventVo;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.mainmenu.MainMenu;
|
||||
import net.pixvi.myr.panel.randomevent.FarmEventImgPanel;
|
||||
import net.pixvi.myr.panel.randomevent.FarmEventStoryPanel;
|
||||
import net.pixvi.myr.panel.story.StoryPanel;
|
||||
import net.pixvi.myr.panel.taskstartpanel.TaskStartPanel;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
import net.pixvi.psg.ui.PSGPopPanel;
|
||||
|
||||
public class PosCenter extends Singleton
|
||||
{
|
||||
|
||||
public var curPos:String;
|
||||
|
||||
public function PosCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function activity(pos:String) : void
|
||||
{
|
||||
getIns().activity(pos);
|
||||
String(123);
|
||||
}
|
||||
|
||||
public static function getIns() : PosCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PosCenter) as PosCenter;
|
||||
}
|
||||
|
||||
public function activity(pos:String) : void
|
||||
{
|
||||
curPos = pos;
|
||||
update();
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
var task:TaskVo = null;
|
||||
var i:int = 0;
|
||||
var event:RandomEventVo = null;
|
||||
var npcList:Array = [];
|
||||
var tasks:Array = Master.tasks;
|
||||
for(i = 0; i < tasks.length; )
|
||||
{
|
||||
task = tasks[i];
|
||||
if(!task.canFinish() && task.stepVo != null && task.stepVo.hasTalk(curPos) && task.stepVo.canShow() && task.closed != true)
|
||||
{
|
||||
if(task.stepVo.auto)
|
||||
{
|
||||
if(!TaskStartPanel.getIns().showing)
|
||||
{
|
||||
talkHandler(new MYREvent(MYREvent.TALK,task));
|
||||
}
|
||||
break;
|
||||
}
|
||||
npcList.push(task);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(Master.history.openRandomEvent && RandomEventCenter.getIns().atLeastRefreshOnce)
|
||||
{
|
||||
for each(var eventTypeId:String in Master.randomEvent)
|
||||
{
|
||||
event = new RandomEventVo();
|
||||
event.typeId = eventTypeId;
|
||||
if(event.hasTalk(curPos))
|
||||
{
|
||||
npcList.push(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
for each(var posnpc:PositionNPC in Table.npc_position)
|
||||
{
|
||||
if(posnpc.position == curPos && posnpc.condition.check() && posnpc.random >= Math.random())
|
||||
{
|
||||
npcList.push(posnpc);
|
||||
}
|
||||
}
|
||||
MainMenu.getIns().ui.list_npc.setDatas(npcList);
|
||||
MainMenu.getIns().ui.list_npc.addEventListener(MYREvent.TALK,talkHandler);
|
||||
MainMenu.getIns().ui.npcListReshow();
|
||||
}
|
||||
|
||||
public function talkHandler(e:MYREvent = null) : void
|
||||
{
|
||||
var p:PSGPopPanel = null;
|
||||
var event:RandomEventVo = null;
|
||||
var posnpc:PositionNPC = null;
|
||||
if(e.data is TaskVo)
|
||||
{
|
||||
p = MainMenu.getIns().curPanel;
|
||||
TaskStartPanel.getIns().start(e.data as TaskVo,p);
|
||||
}
|
||||
else if(e.data is RandomEventVo)
|
||||
{
|
||||
event = e.data as RandomEventVo;
|
||||
if(event.hasPositionStory)
|
||||
{
|
||||
FarmEventStoryPanel.getIns().startEvent(event,MainMenu.getIns().curPanel);
|
||||
}
|
||||
else
|
||||
{
|
||||
FarmEventImgPanel.getIns().popIn();
|
||||
}
|
||||
}
|
||||
else if(e.data is PositionNPC)
|
||||
{
|
||||
posnpc = e.data as PositionNPC;
|
||||
StoryPanel.getIns().start(posnpc.getStory());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.net.NetPotential;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class PotentialCenter
|
||||
{
|
||||
|
||||
private var onAddPotentialComplete:Function;
|
||||
|
||||
private var addPotential_para:Object;
|
||||
|
||||
private var onPotentialLevelUpComplete:Function;
|
||||
|
||||
private var potentialLevelUp_para:Object;
|
||||
|
||||
public function PotentialCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : PotentialCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PotentialCenter) as PotentialCenter;
|
||||
}
|
||||
|
||||
public function getAddPotentialItem(element:int) : ItemVo
|
||||
{
|
||||
return BagCenter.getIns().getByType(Table.potential_info.potentialElementItem[element]);
|
||||
}
|
||||
|
||||
public function getAddPotentialCostNum() : int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function addPotential(mid:Number, itemId:Number, ability:String = "atk", onComplete:Function = null) : void
|
||||
{
|
||||
onAddPotentialComplete = onComplete;
|
||||
var monvo:MonsterVo = MonsterCenter.getIns().getMonById(mid);
|
||||
var itemvo:ItemVo = getAddPotentialItem(monvo.element);
|
||||
addPotential_para = {
|
||||
"mon":monvo,
|
||||
"ability":ability,
|
||||
"item":itemvo
|
||||
};
|
||||
var traceinfo:Object = {
|
||||
"itemTypeId":itemvo.id,
|
||||
"itemNum":itemvo.num
|
||||
};
|
||||
NetPotential.getIns().addPotential(mid,itemvo.id,ability,addPotentialHandler,traceinfo);
|
||||
}
|
||||
|
||||
private function addPotentialHandler(newptAtk:int, newptDef:int, newptHp:int, newptDex:int) : void
|
||||
{
|
||||
var mon:MonsterVo = addPotential_para.mon;
|
||||
var ability:String = addPotential_para.ability;
|
||||
var itemvo:ItemVo = addPotential_para.item;
|
||||
switch(ability)
|
||||
{
|
||||
case "atk":
|
||||
mon.potential_atk.val = newptAtk;
|
||||
break;
|
||||
case "def":
|
||||
mon.potential_def.val = newptDef;
|
||||
break;
|
||||
case "hp":
|
||||
mon.potential_hp.val = newptHp;
|
||||
break;
|
||||
case "dex":
|
||||
mon.potential_dex.val = newptDex;
|
||||
}
|
||||
BagCenter.getIns().subNum(itemvo.id,getAddPotentialCostNum());
|
||||
TaskCenter.getIns().activityLockStatus(GSub.POTENTIAL_OVER);
|
||||
if(onAddPotentialComplete != null)
|
||||
{
|
||||
onAddPotentialComplete();
|
||||
onAddPotentialComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function potentialLevelUp(mid:Number, onComplete:Function) : void
|
||||
{
|
||||
var item:ItemVo = null;
|
||||
onPotentialLevelUpComplete = onComplete;
|
||||
var mon:MonsterVo = MonsterCenter.getIns().getMonById(mid);
|
||||
var elementItems:Object = Table.potential_info.elementItem[mon.element];
|
||||
var need:Object = Table.potential_info.potentialLevelItem[mon.star][mon.potentialLevel];
|
||||
var itemIds:Array = [];
|
||||
for(var needLv:String in need)
|
||||
{
|
||||
item = BagCenter.getIns().getByType(elementItems[needLv]);
|
||||
itemIds.push(item.id);
|
||||
}
|
||||
potentialLevelUp_para = {
|
||||
"mon":mon,
|
||||
"need":need,
|
||||
"elementItems":elementItems
|
||||
};
|
||||
NetPotential.getIns().potentialLevelUp(mid,itemIds,potentialLevelUpHandler);
|
||||
}
|
||||
|
||||
private function potentialLevelUpHandler(newLevel:int) : void
|
||||
{
|
||||
var item:ItemVo = null;
|
||||
var mon:MonsterVo = potentialLevelUp_para.mon;
|
||||
mon.potentialLevel = newLevel;
|
||||
var need:Object = potentialLevelUp_para.need;
|
||||
var elementItems:Object = potentialLevelUp_para.elementItems;
|
||||
for(var needLv:String in need)
|
||||
{
|
||||
item = BagCenter.getIns().getByType(elementItems[needLv]);
|
||||
BagCenter.getIns().subNumByType(elementItems[needLv],need[needLv]);
|
||||
}
|
||||
Alert.showMsg(lang("潜能成功突破至 阶段{0}",newLevel));
|
||||
potentialLevelUp_para = null;
|
||||
if(onPotentialLevelUpComplete != null)
|
||||
{
|
||||
onPotentialLevelUpComplete(newLevel);
|
||||
onPotentialLevelUpComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.pve.PveAreaInfoVo;
|
||||
import net.pixvi.myr.element.pve.PveCharaDataVo;
|
||||
import net.pixvi.myr.element.pve.PveInfoVo;
|
||||
import net.pixvi.myr.element.pve.PveRankVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.net.NetPve;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class PveCenter extends Singleton
|
||||
{
|
||||
|
||||
public var botInited:Boolean = false;
|
||||
|
||||
private var onGetPveInfoComplete:Function;
|
||||
|
||||
private var onStartPveComplete:Function;
|
||||
|
||||
public var pve_me:PveCharaDataVo;
|
||||
|
||||
public var pve_enemy:PveCharaDataVo;
|
||||
|
||||
public var cur_area:PveAreaInfoVo;
|
||||
|
||||
private var onFinishPveComplete:Function;
|
||||
|
||||
private var onWeekRewardComplete:Function;
|
||||
|
||||
private var weekReward_buff:Object;
|
||||
|
||||
public function PveCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : PveCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(PveCenter) as PveCenter;
|
||||
}
|
||||
|
||||
public function buildCheckVoByBattleMon(battlemon:BattleMon) : Object
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:Object = {};
|
||||
var pveMonData:Object = battlemon.monVo;
|
||||
mon.mid = pveMonData.monsterId;
|
||||
mon.type = pveMonData.typeId;
|
||||
mon.equips = [];
|
||||
for(i = 1; i <= 5; )
|
||||
{
|
||||
if(pveMonData["equip" + i + "TypeId"] > 0)
|
||||
{
|
||||
mon.equips.push(pveMonData["equip" + i + "TypeId"]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
mon.atk = pveMonData.atk;
|
||||
mon.def = pveMonData.def;
|
||||
mon.hp = pveMonData.hp;
|
||||
mon.dex = pveMonData.dex;
|
||||
mon.crit = pveMonData.crit;
|
||||
mon.spd_atk_add = pveMonData.atkSpd;
|
||||
mon.atkVim = pveMonData.atkVim;
|
||||
mon.selfCure = pveMonData.selfCure;
|
||||
mon.deadBoom = pveMonData.deadBoom;
|
||||
mon.atkStun = pveMonData.atkStun;
|
||||
mon.defStun = pveMonData.defStun;
|
||||
mon.atkPoi = pveMonData.atkPoi;
|
||||
mon.atkPoiDmg = pveMonData.atkPoiDmg;
|
||||
if(mon.apCost < 1)
|
||||
{
|
||||
mon.apCost = 1;
|
||||
}
|
||||
mon.skillCooldown = pveMonData.skillCooldown;
|
||||
mon.sunFire = pveMonData.sunFire;
|
||||
mon.moonHeal = pveMonData.moonHeal;
|
||||
mon.thorns = pveMonData.thorns;
|
||||
mon.equips = [];
|
||||
return mon;
|
||||
}
|
||||
|
||||
public function getPveAreaInfoByCity(city:int) : PveAreaInfoVo
|
||||
{
|
||||
switch(city - 1)
|
||||
{
|
||||
case 0:
|
||||
return Master.pveInfo.pve_llts;
|
||||
case 1:
|
||||
return Master.pveInfo.pve_lah;
|
||||
case 2:
|
||||
return Master.pveInfo.pve_bslm;
|
||||
case 3:
|
||||
return Master.pveInfo.pve_nslm;
|
||||
case 4:
|
||||
return Master.pveInfo.pve_lrj;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getPveInfo(onComplete:Function) : void
|
||||
{
|
||||
onGetPveInfoComplete = onComplete;
|
||||
NetPve.getIns().getPveInfo(getPveInfoHandler);
|
||||
}
|
||||
|
||||
private function getPveInfoHandler(re:Object) : void
|
||||
{
|
||||
var areaInfoVo:PveAreaInfoVo = null;
|
||||
var infovo:PveInfoVo = new PveInfoVo();
|
||||
if(re.pve_llts == null)
|
||||
{
|
||||
re.pve_llts = null;
|
||||
}
|
||||
for(var pveKey:String in re)
|
||||
{
|
||||
areaInfoVo = new PveAreaInfoVo();
|
||||
areaInfoVo.onData(re[pveKey],pveKey);
|
||||
infovo[pveKey] = areaInfoVo;
|
||||
}
|
||||
Master.pveInfo = infovo;
|
||||
if(onGetPveInfoComplete != null)
|
||||
{
|
||||
onGetPveInfoComplete();
|
||||
onGetPveInfoComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function startPve(pveAreaName:String, onComplete:Function) : void
|
||||
{
|
||||
trace("[pve开始匹配]");
|
||||
onStartPveComplete = onComplete;
|
||||
NetPve.getIns().startPve(pveAreaName,startPveHandler);
|
||||
}
|
||||
|
||||
private function startPveHandler(re:Object) : void
|
||||
{
|
||||
if(re.resCode == 100)
|
||||
{
|
||||
Alert.yes("提示","挑战赛暂未开放,请稍后再来吧。");
|
||||
}
|
||||
pve_me = new PveCharaDataVo();
|
||||
pve_me.onData(re.myself);
|
||||
if(re.enemy.masterInfo == null)
|
||||
{
|
||||
trace("[pve没有匹配到玩家]");
|
||||
pve_enemy = getBotVo(cur_area);
|
||||
pve_enemy.isBot = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("[pve匹配到玩家]");
|
||||
pve_enemy = new PveCharaDataVo();
|
||||
pve_enemy.onData(re.enemy);
|
||||
}
|
||||
if(onStartPveComplete != null)
|
||||
{
|
||||
onStartPveComplete();
|
||||
onStartPveComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function finishPve(battleData:BattleData, onComplete:Function) : void
|
||||
{
|
||||
onFinishPveComplete = onComplete;
|
||||
NetPve.getIns().finishPve(cur_area.pveAreaType,battleData,finishPveHandler);
|
||||
}
|
||||
|
||||
private function finishPveHandler(re:Object) : void
|
||||
{
|
||||
var reward:RewardResultVo = RewardCenter.getRewardResultVoByData(re.reward);
|
||||
var finalScore:int = int(re.param.finalScore);
|
||||
cur_area.num++;
|
||||
if(cur_area.score != finalScore)
|
||||
{
|
||||
cur_area.oldScore = cur_area.score;
|
||||
cur_area.score = finalScore;
|
||||
cur_area.hasUpdate = true;
|
||||
}
|
||||
if(onFinishPveComplete != null)
|
||||
{
|
||||
onFinishPveComplete(reward);
|
||||
onFinishPveComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getBotsByStar(maxStar:int, botType:String = "all") : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var pveBotData:Object = null;
|
||||
var star:int = 0;
|
||||
i = 0;
|
||||
var pveBotData2:Object = null;
|
||||
var bots:Array = [];
|
||||
if(!botInited)
|
||||
{
|
||||
for(i = 0; i < Table.pve_bot.length; )
|
||||
{
|
||||
pveBotData = Table.pve_bot[i];
|
||||
star = 0;
|
||||
for each(var mondata:Object in pveBotData.teamData.mons)
|
||||
{
|
||||
star += MonsterVo.getStar(mondata.type);
|
||||
}
|
||||
pveBotData.star = star;
|
||||
if(pveBotData.star <= maxStar && (pveBotData.botType == botType || botType == "all"))
|
||||
{
|
||||
bots.push(pveBotData);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
Table.pve_bot.sortOn("zdl",16);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = 0;
|
||||
while(i < Table.pve_bot.length)
|
||||
{
|
||||
pveBotData2 = Table.pve_bot[i];
|
||||
if(pveBotData2.star <= maxStar && (pveBotData2.botType == botType || botType == "all"))
|
||||
{
|
||||
bots.push(pveBotData2);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return bots;
|
||||
}
|
||||
|
||||
public function getBotVo(area:PveAreaInfoVo) : PveCharaDataVo
|
||||
{
|
||||
var i:int = 0;
|
||||
var getBots:Array = getBotsByStar(Table.pve_info.pveArea[area.pveAreaType].maxStar,Table.pve_info.pveArea[area.pveAreaType].botType);
|
||||
var myTeamZdl:int = TeamCenter.getIns().getTeamZdl(area.pveAreaType);
|
||||
trace("[pve我方总战力]",myTeamZdl);
|
||||
var bots:Array = [];
|
||||
for(i = 0; i < getBots.length; )
|
||||
{
|
||||
if(Math.abs(myTeamZdl - getBots[i].zdl) < myTeamZdl * 0.3)
|
||||
{
|
||||
bots.push(getBots[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(bots.length == 0)
|
||||
{
|
||||
if(myTeamZdl > getBots[getBots.length - 1])
|
||||
{
|
||||
trace("[pve触发上限机器人保底]");
|
||||
bots.push(bots[bots.length - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace("[pve触发下限机器人保底]");
|
||||
bots.push(getBots[0],getBots[1],getBots[2]);
|
||||
}
|
||||
}
|
||||
var bot:Object = Random.element(bots);
|
||||
trace("[pve机器人战力]",bot.zdl);
|
||||
var pveCharaDataVo:PveCharaDataVo = new PveCharaDataVo();
|
||||
pveCharaDataVo.onBot(bot,area);
|
||||
return pveCharaDataVo;
|
||||
}
|
||||
|
||||
public function getPveBattleTeamVo(area:PveAreaInfoVo, enemyData:PveCharaDataVo) : BattleTeamVo
|
||||
{
|
||||
var enemyTeamVo:BattleTeamVo = new BattleTeamVo();
|
||||
enemyTeamVo.ai = 2;
|
||||
enemyTeamVo.ai_search = 2;
|
||||
enemyTeamVo.apMax = enemyTeamVo.ap = GameMath.apByLevel(enemyData.masterInfo.level);
|
||||
enemyTeamVo.numMax = area.getNumMax(GameMath.getStageNumByLevel(enemyData.masterInfo.level));
|
||||
enemyTeamVo.team = 2;
|
||||
enemyTeamVo.name = enemyData.masterInfo.roleName;
|
||||
enemyTeamVo.mons = enemyData.pveBattleData.pveBattleMonVoArray;
|
||||
return enemyTeamVo;
|
||||
}
|
||||
|
||||
public function getRankByScore(score:int) : PveRankVo
|
||||
{
|
||||
var vo:Object = null;
|
||||
var rankinfo:Object = null;
|
||||
for(var keytype:String in Table.pve_info.rankInfo)
|
||||
{
|
||||
rankinfo = Table.pve_info.rankInfo[keytype];
|
||||
if(score >= rankinfo.score && (vo == null || vo.score < rankinfo.score))
|
||||
{
|
||||
vo = rankinfo;
|
||||
}
|
||||
}
|
||||
var rankvo:PveRankVo = new PveRankVo();
|
||||
rankvo.rankType = vo.type;
|
||||
return rankvo;
|
||||
}
|
||||
|
||||
public function weekReward(pveAreaName:String, onComplete:Function) : void
|
||||
{
|
||||
onWeekRewardComplete = onComplete;
|
||||
weekReward_buff = {"pveAreaName":pveAreaName};
|
||||
NetPve.getIns().weekReward(pveAreaName,weekRewardHandler);
|
||||
}
|
||||
|
||||
private function weekRewardHandler(re:Object) : void
|
||||
{
|
||||
RewardCenter.getIns().getRewardByData(re.reward,true,"panel");
|
||||
getAreaByAreaType(weekReward_buff.pveAreaName).weekRewardGet = true;
|
||||
if(onWeekRewardComplete != null)
|
||||
{
|
||||
onWeekRewardComplete();
|
||||
onWeekRewardComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAreaByAreaType(type:String) : PveAreaInfoVo
|
||||
{
|
||||
return Master.pveInfo[type];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.myr.element.randomevent.RandomEventType;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetRandomEvent;
|
||||
import net.pixvi.pfw.event.PiEvent;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class RandomEventCenter
|
||||
{
|
||||
|
||||
public var atLeastRefreshOnce:Boolean = false;
|
||||
|
||||
private var farmEventChecking:Boolean = false;
|
||||
|
||||
private var onFinishFarmEventComplete:Function;
|
||||
|
||||
private var finishFarmEvent_para:Object;
|
||||
|
||||
public function RandomEventCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : RandomEventCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RandomEventCenter) as RandomEventCenter;
|
||||
}
|
||||
|
||||
public function get farmEventCooldown() : Boolean
|
||||
{
|
||||
if(Master.randomEventTimer[RandomEventType.FARM_TIMER_NAME] == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(Master.randomEventTimer[RandomEventType.FARM_TIMER_NAME] < TimeCenter.timestamp * 1000)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hasFarmEvent() : Boolean
|
||||
{
|
||||
if(Master.randomEvent[RandomEventType.FARM_TIMER_NAME] != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function autoCheckFarmEvent() : void
|
||||
{
|
||||
if(farmEventChecking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(farmEventCooldown)
|
||||
{
|
||||
trace("牧场事件冷却!刷新牧场事件。");
|
||||
Master.randomEventTimer[RandomEventType.FARM_TIMER_NAME] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
atLeastRefreshOnce = true;
|
||||
}
|
||||
if(Master.randomEventTimer[RandomEventType.FARM_TIMER_NAME] < TimeCenter.timestamp * 1000)
|
||||
{
|
||||
farmEventChecking = true;
|
||||
NetRandomEvent.getIns().getFarmEvent(getFarmEventHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function getFarmEventHandler(hasEvent:Boolean, synchroTime:Object, farmEventType:String, masterEventTimer:Object) : void
|
||||
{
|
||||
if(synchroTime != null)
|
||||
{
|
||||
ClockDriver.getIns().timestamp = (synchroTime as Number) / 1000 - 1;
|
||||
return;
|
||||
}
|
||||
if(hasEvent)
|
||||
{
|
||||
Master.randomEvent[RandomEventType.FARM_TIMER_NAME] = farmEventType;
|
||||
}
|
||||
Master.randomEventTimer = masterEventTimer;
|
||||
atLeastRefreshOnce = true;
|
||||
GlobalBroadcast.dispatchEvent(new PiEvent(MYREvent.RANDOM_EVENT_CHANGE));
|
||||
farmEventChecking = false;
|
||||
}
|
||||
|
||||
public function finishFarmEvent(onComplete:Function) : void
|
||||
{
|
||||
onFinishFarmEventComplete = onComplete;
|
||||
finishFarmEvent_para = {"typeId":Master.randomEvent[RandomEventType.FARM_TIMER_NAME]};
|
||||
NetRandomEvent.getIns().finishFarmEvent(finishFarmEventHandler);
|
||||
}
|
||||
|
||||
public function finishFarmEventHandler(rewardData:Object, getTasks:Array, unlockTasks:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
delete Master.randomEvent[RandomEventType.FARM_TIMER_NAME];
|
||||
var rewardresultvo:RewardResultVo = RewardCenter.getIns().getRewardByData(rewardData,false);
|
||||
if(getTasks != null && getTasks.length > 0)
|
||||
{
|
||||
for each(var taskvo:Object in getTasks)
|
||||
{
|
||||
TaskCenter.getIns().addLocalTask(TaskCenter.getTaskByTaskData(taskvo));
|
||||
}
|
||||
}
|
||||
if(unlockTasks != null && unlockTasks.length > 0)
|
||||
{
|
||||
for(i = 0; i < unlockTasks.length; )
|
||||
{
|
||||
unlockTasks[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new PiEvent(MYREvent.RANDOM_EVENT_CHANGE));
|
||||
finishFarmEvent_para = null;
|
||||
if(onFinishFarmEventComplete != null)
|
||||
{
|
||||
onFinishFarmEventComplete(rewardresultvo);
|
||||
onFinishFarmEventComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.rank.RankVo;
|
||||
import net.pixvi.myr.net.NetRank;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class RankCenter extends Singleton
|
||||
{
|
||||
|
||||
public var buffRanks:Object = {};
|
||||
|
||||
public var buffTime:int = 180;
|
||||
|
||||
private var onGetRankComplete:Function;
|
||||
|
||||
private var getRank_type:String;
|
||||
|
||||
public function RankCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : RankCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RankCenter) as RankCenter;
|
||||
}
|
||||
|
||||
public function getRank(type:String, onComplete:Function) : void
|
||||
{
|
||||
var buffRank:RankVo = null;
|
||||
onGetRankComplete = onComplete;
|
||||
if(buffRanks[type] != null)
|
||||
{
|
||||
buffRank = buffRanks[type];
|
||||
if(TimeCenter.timestamp - buffRank.rankTime < buffTime)
|
||||
{
|
||||
onComplete(buffRank);
|
||||
return;
|
||||
}
|
||||
}
|
||||
getRank_type = type;
|
||||
var para:Object = {"rankName":type};
|
||||
NetRank.getIns().getRank(type,getRankHandler);
|
||||
}
|
||||
|
||||
private function getRankHandler(re:Object) : void
|
||||
{
|
||||
var rankvo:RankVo = new RankVo();
|
||||
rankvo.rankTime = TimeCenter.timestamp;
|
||||
rankvo.rankType = getRank_type;
|
||||
rankvo.onData(re);
|
||||
buffRanks[rankvo.rankType] = rankvo;
|
||||
if(onGetRankComplete != null)
|
||||
{
|
||||
onGetRankComplete(rankvo);
|
||||
onGetRankComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class RewardCenter
|
||||
{
|
||||
|
||||
public function RewardCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : RewardCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RewardCenter) as RewardCenter;
|
||||
}
|
||||
|
||||
public static function getRewardResultVoByData(data:Object) : RewardResultVo
|
||||
{
|
||||
var reward:RewardResultVo = new RewardResultVo();
|
||||
reward.exp = data.exp;
|
||||
reward.ke = data.ke;
|
||||
reward.money = data.money;
|
||||
reward.ti = data.ti;
|
||||
reward.items = data.items;
|
||||
reward.monsters = data.monsters;
|
||||
return reward;
|
||||
}
|
||||
|
||||
public function getReward(reward:RewardResultVo, show:Boolean = false, showMode:String = "alert", onShowPanelComplete:Function = null, checkLevelUp:Boolean = true) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var showalert:Boolean = false;
|
||||
if(show && showMode == "alert")
|
||||
{
|
||||
showalert = true;
|
||||
}
|
||||
MasterCenter.getIns().addMoney(reward.money,showalert);
|
||||
MasterCenter.getIns().addKe(reward.ke,showalert);
|
||||
MasterCenter.getIns().addTi(reward.ti,showalert);
|
||||
MasterCenter.getIns().addExp(reward.exp,showalert);
|
||||
var mons:Array = reward.getMonsters();
|
||||
var items:Array = reward.getItems();
|
||||
for(i = 0; i < items.length; )
|
||||
{
|
||||
BagCenter.getIns().addItem(items[i]);
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < mons.length; )
|
||||
{
|
||||
MonsterCenter.getIns().getLocalMonster(mons[j]);
|
||||
j++;
|
||||
}
|
||||
if(show && showMode == "panel")
|
||||
{
|
||||
if(reward.exp == 0)
|
||||
{
|
||||
checkLevelUp = false;
|
||||
}
|
||||
RewardShowPanel.showByVo(reward,onShowPanelComplete,checkLevelUp);
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ITEM_NUM_CHANGE,null));
|
||||
}
|
||||
|
||||
public function getRewardByData(data:Object, show:Boolean = false, showMode:String = "alert", onShowPanelComplete:Function = null) : RewardResultVo
|
||||
{
|
||||
var res:RewardResultVo = getRewardResultVoByData(data);
|
||||
getReward(res,show,showMode,onShowPanelComplete);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.room.RoomVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetRoom;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class RoomCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onBuyRoomComplete:Function;
|
||||
|
||||
private var BuyRoom_para:Object;
|
||||
|
||||
private var onBuyKeRoomComplete:Function;
|
||||
|
||||
private var BuyKeRoom_para:Object;
|
||||
|
||||
private var onEditRoomComplete:Function;
|
||||
|
||||
private var editRoom_para:Object;
|
||||
|
||||
public function RoomCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getRoomByRoomData(roomData:Object) : RoomVo
|
||||
{
|
||||
var room:RoomVo = new RoomVo();
|
||||
room.id = roomData.id;
|
||||
room.type = roomData.typeId;
|
||||
room.openType = roomData.openType;
|
||||
return room;
|
||||
}
|
||||
|
||||
public static function getIns() : RoomCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(RoomCenter) as RoomCenter;
|
||||
}
|
||||
|
||||
public function addRoom(room:RoomVo) : RoomVo
|
||||
{
|
||||
Master.rooms.push(room);
|
||||
room.sort = room.position;
|
||||
return room;
|
||||
}
|
||||
|
||||
public function buyRoom(onComplete:Function) : void
|
||||
{
|
||||
onBuyRoomComplete = onComplete;
|
||||
var val:Object = Table.room_price[Master.history.numAddRoom];
|
||||
BuyRoom_para = {"money":val.money};
|
||||
NetRoom.getIns().createRoom(1,buyRoomHandler);
|
||||
}
|
||||
|
||||
private function buyRoomHandler(roomData:Object) : void
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-BuyRoom_para.money,true);
|
||||
var roomvo:RoomVo = RoomCenter.getRoomByRoomData(roomData);
|
||||
addRoom(roomvo);
|
||||
Master.history.countRoom++;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ROOM_ADD,roomvo));
|
||||
if(onBuyRoomComplete != null)
|
||||
{
|
||||
onBuyRoomComplete();
|
||||
onBuyRoomComplete = null;
|
||||
BuyRoom_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function buyKeRoom(onComplete:Function) : void
|
||||
{
|
||||
onBuyKeRoomComplete = onComplete;
|
||||
var val:Object = Table.room_price[Master.history.numKeAddRoom];
|
||||
BuyKeRoom_para = {"ke":val.ke};
|
||||
NetRoom.getIns().createRoom(2,buyKeRoomHandler);
|
||||
}
|
||||
|
||||
private function buyKeRoomHandler(roomData:Object) : void
|
||||
{
|
||||
MasterCenter.getIns().addKe(-BuyKeRoom_para.ke,true);
|
||||
var roomvo:RoomVo = RoomCenter.getRoomByRoomData(roomData);
|
||||
addRoom(roomvo);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ROOM_ADD,roomvo));
|
||||
if(onBuyKeRoomComplete != null)
|
||||
{
|
||||
onBuyKeRoomComplete();
|
||||
onBuyKeRoomComplete = null;
|
||||
BuyKeRoom_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function editRoom(room:RoomVo, type:Object, useVoucher:Boolean, onComplete:Function) : void
|
||||
{
|
||||
onEditRoomComplete = onComplete;
|
||||
if(useVoucher)
|
||||
{
|
||||
editRoom_para = {
|
||||
"oname":room.autoName,
|
||||
"room":room,
|
||||
"need":type.voucherNeed,
|
||||
"type":type.type,
|
||||
"needMoney":0,
|
||||
"needKe":0
|
||||
};
|
||||
NetRoom.getIns().editRoom(room.id,type.type,true,editRoomHandler);
|
||||
}
|
||||
else
|
||||
{
|
||||
editRoom_para = {
|
||||
"oname":room.autoName,
|
||||
"room":room,
|
||||
"need":type.need,
|
||||
"type":type.type,
|
||||
"needMoney":type.needMoney,
|
||||
"needKe":type.needKe
|
||||
};
|
||||
NetRoom.getIns().editRoom(room.id,type.type,false,editRoomHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function editRoomHandler(re:Object = null) : void
|
||||
{
|
||||
editRoom_para.room.type = editRoom_para.type;
|
||||
MasterCenter.getIns().addMoney(-editRoom_para.needMoney);
|
||||
MasterCenter.getIns().addKe(-editRoom_para.needKe);
|
||||
BagCenter.getIns().subLocalNeed(editRoom_para.need);
|
||||
TaskCenter.getIns().activityLockStatus(GSub.TASK_STATUS_BUILD);
|
||||
var notice:String = lang("改造 {0} 成为 {1}",CP.room(int(editRoom_para.room.position) + 1 + ":" + editRoom_para.oname),CP.room(int(editRoom_para.room.position) + 1 + ":" + editRoom_para.room.autoName));
|
||||
Alert.showMsg(notice,3000);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.ROOM_EDIT,{"room":editRoom_para.room}));
|
||||
if(onEditRoomComplete != null)
|
||||
{
|
||||
onEditRoomComplete();
|
||||
onEditRoomComplete = null;
|
||||
editRoom_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getRoomById(id:int) : RoomVo
|
||||
{
|
||||
for each(var r:RoomVo in Master.rooms)
|
||||
{
|
||||
if(r.id == id)
|
||||
{
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRoomWithPosition(roomVo:RoomVo, float:int) : RoomVo
|
||||
{
|
||||
var flag:int = Master.rooms.indexOf(roomVo) + float;
|
||||
if(flag < 0)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
if(flag >= Master.rooms.length)
|
||||
{
|
||||
flag = Master.rooms.length - 1;
|
||||
}
|
||||
return Master.rooms[flag];
|
||||
}
|
||||
|
||||
public function getRoomWithSort(roomVo:RoomVo, float:int) : RoomVo
|
||||
{
|
||||
var rooms:Array = MasterCenter.getIns().getSortedRoomArray();
|
||||
var flag:int = rooms.indexOf(roomVo) + float;
|
||||
if(flag < 0)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
if(flag >= rooms.length)
|
||||
{
|
||||
flag = rooms.length - 1;
|
||||
}
|
||||
return rooms[flag];
|
||||
}
|
||||
|
||||
public function getRoomByPosition(position:int) : RoomVo
|
||||
{
|
||||
return Master.rooms[position];
|
||||
}
|
||||
|
||||
public function getRoomBySort(sort:int) : RoomVo
|
||||
{
|
||||
var rooms:Array = MasterCenter.getIns().getSortedRoomArray();
|
||||
if(rooms[sort] != null)
|
||||
{
|
||||
return rooms[sort];
|
||||
}
|
||||
return getRoomByPosition(sort);
|
||||
}
|
||||
|
||||
public function getRoomMonster(roomid:int) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var mons:Array = [];
|
||||
for(i = 0; i < Master.monsters.length; )
|
||||
{
|
||||
if(Master.monsters[i].roomId == roomid)
|
||||
{
|
||||
mons.push(Master.monsters[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return mons;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.npc.ConditionVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.net.NetExchange;
|
||||
import net.pixvi.myr.net.NetShop;
|
||||
import net.pixvi.myr.panel.reward.RewardShowPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class ShopCenter extends Singleton
|
||||
{
|
||||
|
||||
public static var lastUpdateDay:int = -1;
|
||||
|
||||
public var moneyShopInfo:Array;
|
||||
|
||||
public var keShopInfo:Array;
|
||||
|
||||
private var refreshShopInfo_para:int;
|
||||
|
||||
private var onRefreshShopInfoComplete:Function;
|
||||
|
||||
private var onBuyShopItemComplete:Function;
|
||||
|
||||
private var buyShopItem_para:Object;
|
||||
|
||||
private var onExchangeItemComplete:Function;
|
||||
|
||||
private var exchangeItem_id:String = "";
|
||||
|
||||
private var exchangeNum:int = 0;
|
||||
|
||||
private var exchange_showReward:Boolean = false;
|
||||
|
||||
public function ShopCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : ShopCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(ShopCenter) as ShopCenter;
|
||||
}
|
||||
|
||||
public function getItemsByTeamAndCostType(team:String = "shop", costType:String = "all") : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
i = 0;
|
||||
var j:int = 0;
|
||||
var vo:ConditionVo = null;
|
||||
var arr:Array = [];
|
||||
if(costType == "all" || costType == "ke")
|
||||
{
|
||||
for(i = 0; i < keShopInfo.length; )
|
||||
{
|
||||
if(Table.shop_info[keShopInfo[i].id] != null)
|
||||
{
|
||||
if(Table.shop_info[keShopInfo[i].id].team == team)
|
||||
{
|
||||
arr.push(keShopInfo[i]);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(costType == "all" || costType == "money")
|
||||
{
|
||||
for(i = 0; i < moneyShopInfo.length; )
|
||||
{
|
||||
if(Table.shop_info[moneyShopInfo[i].id] != null)
|
||||
{
|
||||
if(Table.shop_info[moneyShopInfo[i].id].team == team)
|
||||
{
|
||||
arr.push(moneyShopInfo[i]);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for(j = 0; j < arr.length; )
|
||||
{
|
||||
if(arr[j].condition != null)
|
||||
{
|
||||
vo = new ConditionVo(arr[j].condition);
|
||||
if(!vo.check())
|
||||
{
|
||||
arr.splice(j,1);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function refreshShopInfo(onComplete:Function) : void
|
||||
{
|
||||
onRefreshShopInfoComplete = onComplete;
|
||||
var todayDate:int = MyrCalendar.getShowDate(TimeCenter.timestamp * 1000).date;
|
||||
if(todayDate == lastUpdateDay)
|
||||
{
|
||||
if(onRefreshShopInfoComplete != null)
|
||||
{
|
||||
onRefreshShopInfoComplete();
|
||||
onRefreshShopInfoComplete = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
refreshShopInfo_para = todayDate;
|
||||
NetShop.getIns().getShopInfo(refreshShopInfoHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function refreshShopInfoHandler(moneyShopList:Array = null, keShopList:Array = null, shopNum:Object = null) : void
|
||||
{
|
||||
this.moneyShopInfo = moneyShopList;
|
||||
this.keShopInfo = keShopList;
|
||||
this.fixShopNum();
|
||||
for(var key:String in shopNum)
|
||||
{
|
||||
Master.history.shopNum[key] = shopNum[key];
|
||||
}
|
||||
lastUpdateDay = refreshShopInfo_para;
|
||||
if(onRefreshShopInfoComplete != null)
|
||||
{
|
||||
onRefreshShopInfoComplete();
|
||||
onRefreshShopInfoComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function buyShopItem(shopId:int, shopType:int, num:int = 1, onComplete:Function = null) : void
|
||||
{
|
||||
onBuyShopItemComplete = onComplete;
|
||||
buyShopItem_para = {
|
||||
"shopId":shopId,
|
||||
"shopType":shopType,
|
||||
"num":num
|
||||
};
|
||||
NetShop.getIns().buyShopItem(shopId,shopType,num,buyShopItemHandler);
|
||||
}
|
||||
|
||||
private function buyShopItemHandler(itemDatas:Array, costMoney:int, costKe:int) : void
|
||||
{
|
||||
var rewards:RewardResultVo = new RewardResultVo();
|
||||
rewards.items = itemDatas;
|
||||
RewardCenter.getIns().getReward(rewards,true,"panel");
|
||||
MasterCenter.getIns().addMoney(-costMoney,true);
|
||||
MasterCenter.getIns().addKe(-costKe,true);
|
||||
Master.history.shopNum[buyShopItem_para.shopId] += buyShopItem_para.num;
|
||||
buyShopItem_para = null;
|
||||
if(onBuyShopItemComplete != null)
|
||||
{
|
||||
onBuyShopItemComplete();
|
||||
onBuyShopItemComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function fixShopNum() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
Master.history.shopNum = {};
|
||||
for(i = 0; i < keShopInfo.length; )
|
||||
{
|
||||
Master.history.shopNum[keShopInfo[i].id] = 0;
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < moneyShopInfo.length; )
|
||||
{
|
||||
Master.history.shopNum[moneyShopInfo[j].id] = 0;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
public function exchangeItem(exchangeId:String, num:int, onComplete:Function, showReward:Boolean = false) : void
|
||||
{
|
||||
onExchangeItemComplete = onComplete;
|
||||
exchangeItem_id = exchangeId;
|
||||
exchangeNum = num;
|
||||
exchange_showReward = showReward;
|
||||
NetExchange.getIns().exchangeItem(exchangeId,num,exchangeItemHandler);
|
||||
}
|
||||
|
||||
private function exchangeItemHandler(rewardData:Object) : void
|
||||
{
|
||||
var today:int = 0;
|
||||
var preday:int = 0;
|
||||
var rewardResultVo:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
RewardCenter.getIns().getReward(rewardResultVo);
|
||||
var cost:CostVo = new CostVo();
|
||||
cost.setByVo(Table.exchange_info[exchangeItem_id].need);
|
||||
if(Table.exchange_info[exchangeItem_id].exchangeCondition != null)
|
||||
{
|
||||
if(Master.history.exchangeNum[exchangeItem_id] == null)
|
||||
{
|
||||
Master.history.exchangeNum[exchangeItem_id] = {
|
||||
"exchangeId":exchangeItem_id,
|
||||
"exchangeNum":exchangeNum,
|
||||
"exchangeTime":TimeCenter.timestamp * 1000
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
today = MyrCalendar.getDayNumber();
|
||||
preday = MyrCalendar.getDayNumber(Master.history.exchangeNum[exchangeItem_id].exchangeTime);
|
||||
if(today != preday)
|
||||
{
|
||||
Master.history.exchangeNum[exchangeItem_id] = {
|
||||
"exchangeId":exchangeItem_id,
|
||||
"exchangeNum":exchangeNum,
|
||||
"exchangeTime":TimeCenter.timestamp * 1000
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.exchangeNum[exchangeItem_id].exchangeTime = TimeCenter.timestamp * 1000;
|
||||
Master.history.exchangeNum[exchangeItem_id].exchangeNum += exchangeNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
BagCenter.getIns().subLocalCost(cost,false,exchangeNum,true);
|
||||
if(exchange_showReward)
|
||||
{
|
||||
RewardShowPanel.showByVo(rewardResultVo);
|
||||
}
|
||||
if(onExchangeItemComplete != null)
|
||||
{
|
||||
onExchangeItemComplete(rewardResultVo);
|
||||
onExchangeItemComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getExchangeDatas(team:String) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var data:Object = null;
|
||||
var con:ConditionVo = null;
|
||||
var arr:Array = [];
|
||||
for(i = 0; i < Table.exchange_infoArr.length; i++)
|
||||
{
|
||||
data = Table.exchange_infoArr[i];
|
||||
if(data.condition != null)
|
||||
{
|
||||
con = new ConditionVo();
|
||||
con.ondata(data.condition);
|
||||
if(!con.check())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(data.team is Array)
|
||||
{
|
||||
if(data.team.indexOf("all") != -1 || data.team.indexOf(team) != -1)
|
||||
{
|
||||
arr.push(data);
|
||||
}
|
||||
}
|
||||
else if(data.team == team || team == "all")
|
||||
{
|
||||
arr.push(data);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getExchangeLeftNum(id:String) : int
|
||||
{
|
||||
var recordDay:int = 0;
|
||||
var toDay:int = 0;
|
||||
var exchangeData:Object = Table.exchange_info[id];
|
||||
var leftNum:int = 0;
|
||||
if(exchangeData.exchangeCondition != null)
|
||||
{
|
||||
if(Master.history.exchangeNum[exchangeData.id] == null)
|
||||
{
|
||||
leftNum = int(exchangeData.exchangeCondition.exchangeNum);
|
||||
}
|
||||
else if(exchangeData.exchangeCondition.exchangeType == "GLOBAL")
|
||||
{
|
||||
leftNum = exchangeData.exchangeCondition.exchangeNum - Master.history.exchangeNum[exchangeData.id].exchangeNum;
|
||||
}
|
||||
else if(exchangeData.exchangeCondition.exchangeType == "EVERYDAY")
|
||||
{
|
||||
recordDay = MyrCalendar.getDayNumber(Master.history.exchangeNum[exchangeData.id].exchangeTime);
|
||||
toDay = MyrCalendar.getDayNumber();
|
||||
if(toDay != recordDay)
|
||||
{
|
||||
leftNum = int(exchangeData.exchangeCondition.exchangeNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
leftNum = exchangeData.exchangeCondition.exchangeNum - Master.history.exchangeNum[exchangeData.id].exchangeNum;
|
||||
}
|
||||
}
|
||||
return leftNum;
|
||||
}
|
||||
return 2147483647;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.mon.SkinVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetSkin;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class SkinCenter
|
||||
{
|
||||
|
||||
private var onSetSkinComplete:Function;
|
||||
|
||||
private var setSkin_buffId:uint;
|
||||
|
||||
private var setSkin_buffSkinType:String;
|
||||
|
||||
public function SkinCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : SkinCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(SkinCenter) as SkinCenter;
|
||||
}
|
||||
|
||||
public function getMonAllSkins(monTypeId:int, includeNormal:Boolean = true, lockSkin:Boolean = true) : Array
|
||||
{
|
||||
var vo:SkinVo = null;
|
||||
var unlockSkins:Array = [];
|
||||
var lockSkins:Array = [];
|
||||
if(includeNormal)
|
||||
{
|
||||
unlockSkins.push(new SkinVo(0,monTypeId));
|
||||
}
|
||||
for(var skinType:String in Table.skin_info)
|
||||
{
|
||||
if(Table.skin_info[skinType].monType == monTypeId.toString())
|
||||
{
|
||||
vo = new SkinVo(int(skinType));
|
||||
if(vo.hide != true)
|
||||
{
|
||||
if(vo.unlock)
|
||||
{
|
||||
unlockSkins.push(vo);
|
||||
}
|
||||
else
|
||||
{
|
||||
lockSkins.push(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unlockSkins.sortOn("typeId",2);
|
||||
lockSkins.sortOn("typeId",2);
|
||||
if(!lockSkin)
|
||||
{
|
||||
return unlockSkins;
|
||||
}
|
||||
return unlockSkins.concat(lockSkins);
|
||||
}
|
||||
|
||||
public function setSkin(monsterId:int, skinTypeId:String, onComplete:Function) : void
|
||||
{
|
||||
onSetSkinComplete = onComplete;
|
||||
setSkin_buffId = monsterId;
|
||||
setSkin_buffSkinType = skinTypeId;
|
||||
NetSkin.getIns().setSkin(monsterId,skinTypeId,setSkinHandler);
|
||||
}
|
||||
|
||||
private function setSkinHandler(re:Object) : void
|
||||
{
|
||||
var vo:MonsterVo = MonsterCenter.getIns().getMonById(setSkin_buffId);
|
||||
vo.skin = int(setSkin_buffSkinType);
|
||||
vo.skinVo = new SkinVo(vo.skin,vo.type);
|
||||
vo.abilityAdd.update(re.monAdd);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_NUM_CHANGE,{"mon":vo}));
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_SKIN_CHANGE,{"mon":vo}));
|
||||
if(onSetSkinComplete != null)
|
||||
{
|
||||
onSetSkinComplete();
|
||||
onSetSkinComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,479 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.mon.EggVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.stack.StackOpenType;
|
||||
import net.pixvi.myr.element.stack.StackVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetStack;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class StackCenter
|
||||
{
|
||||
|
||||
private var onAddQuality:Function;
|
||||
|
||||
private var addQuality_buffStackId:Number;
|
||||
|
||||
private var addQuality_buffAddPara:String;
|
||||
|
||||
private var speedEgg_para:Object;
|
||||
|
||||
private var onSpeedEggComplete:Function;
|
||||
|
||||
private var onBuyStackComplete:Function;
|
||||
|
||||
private var buyStack_para:Object;
|
||||
|
||||
private var onBuyKeStackComplete:Function;
|
||||
|
||||
private var buyKeStack_para:Object;
|
||||
|
||||
private var fillEggsToStack_para:Object;
|
||||
|
||||
private var onFillEggsToStackComplete:Function;
|
||||
|
||||
private var autoFilling:Boolean = false;
|
||||
|
||||
private var onAutoFillEggToStackComplete:Function;
|
||||
|
||||
private var onMoveMonsToRoomComplete:Function;
|
||||
|
||||
private var moveMonsToRoom_datas:Object;
|
||||
|
||||
public function StackCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : StackCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(StackCenter) as StackCenter;
|
||||
}
|
||||
|
||||
public static function getStackByStackData(stackData:Object) : StackVo
|
||||
{
|
||||
var stack:StackVo = new StackVo();
|
||||
stack.id = stackData.id;
|
||||
stack.position = stackData.position;
|
||||
stack.openType = stackData.openType;
|
||||
stack.monsterId = stackData.monsterId;
|
||||
stack.hpNum = stackData.hpNum;
|
||||
stack.atkNum = stackData.atkNum;
|
||||
stack.defNum = stackData.defNum;
|
||||
stack.dexNum = stackData.dexNum;
|
||||
return stack;
|
||||
}
|
||||
|
||||
public function addQuality(stackId:Number, addPara:String, onComplete:Function) : void
|
||||
{
|
||||
onAddQuality = onComplete;
|
||||
addQuality_buffStackId = stackId;
|
||||
addQuality_buffAddPara = addPara;
|
||||
NetStack.getIns().addQuality(stackId,addPara,addQualityHandler);
|
||||
}
|
||||
|
||||
private function addQualityHandler(re:Object) : void
|
||||
{
|
||||
var addStack:StackVo = getStackById(addQuality_buffStackId);
|
||||
BagCenter.getIns().subNumByType(addStack.getMon().getJxhItemType(),1);
|
||||
addStack[addQuality_buffAddPara + "Num"]++;
|
||||
if(onAddQuality != null)
|
||||
{
|
||||
onAddQuality(re);
|
||||
onAddQuality = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function speedEgg(mid:Number, itemNum:int, onComplete:Function) : void
|
||||
{
|
||||
onSpeedEggComplete = onComplete;
|
||||
var vo:MonsterVo = MonsterCenter.getIns().getMonById(mid);
|
||||
speedEgg_para = {
|
||||
"mon":vo,
|
||||
"num":itemNum
|
||||
};
|
||||
NetStack.getIns().speedMonsters(mid,itemNum,speedEggHandler);
|
||||
}
|
||||
|
||||
private function speedEggHandler(newStartTime:uint) : void
|
||||
{
|
||||
speedEgg_para.mon.timeStart = newStartTime;
|
||||
var itemvo:ItemVo = BagCenter.getIns().getByType(GameMath.speedItemId);
|
||||
BagCenter.getIns().subNum(itemvo.id,speedEgg_para.num,true);
|
||||
if(onSpeedEggComplete != null)
|
||||
{
|
||||
onSpeedEggComplete();
|
||||
onSpeedEggComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function countEmptyStack() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
if(s.isEmpty)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public function buyStack(position:int, onComplete:Function) : void
|
||||
{
|
||||
onBuyStackComplete = onComplete;
|
||||
var val:Object = Table.stack_price[Master.history.numAddStack];
|
||||
buyStack_para = {"money":val.money};
|
||||
NetStack.getIns().addStack(StackOpenType.GOLD,position,buyStackHandler);
|
||||
}
|
||||
|
||||
private function buyStackHandler(reStackData:Object) : void
|
||||
{
|
||||
var stackvo:StackVo = StackCenter.getStackByStackData(reStackData);
|
||||
addStack(stackvo);
|
||||
MasterCenter.getIns().addMoney(-buyStack_para.money,true);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.STACK_ADD,stackvo));
|
||||
if(onBuyStackComplete != null)
|
||||
{
|
||||
onBuyStackComplete();
|
||||
onBuyStackComplete = null;
|
||||
buyStack_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function buyKeStack(position:int, onComplet:Function) : void
|
||||
{
|
||||
onBuyKeStackComplete = onComplet;
|
||||
var val:Object = Table.stack_price[Master.history.numKeAddStack];
|
||||
buyKeStack_para = {"ke":val.ke};
|
||||
NetStack.getIns().addStack(StackOpenType.KE,position,buyKeStackHandler);
|
||||
}
|
||||
|
||||
private function buyKeStackHandler(reStackData:Object) : void
|
||||
{
|
||||
var stackvo:StackVo = StackCenter.getStackByStackData(reStackData);
|
||||
addStack(stackvo);
|
||||
MasterCenter.getIns().addKe(-buyKeStack_para.ke,true);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.STACK_ADD,stackvo));
|
||||
if(onBuyKeStackComplete != null)
|
||||
{
|
||||
onBuyKeStackComplete();
|
||||
onBuyKeStackComplete = null;
|
||||
buyKeStack_para = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getStackByMonster(mid:Number) : StackVo
|
||||
{
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
if(s.monsterId == mid)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addStack(stackvo:StackVo) : StackVo
|
||||
{
|
||||
Master.stacks.push(stackvo);
|
||||
return stackvo;
|
||||
}
|
||||
|
||||
public function fillEggsToStack(pushs:Array, sendEvent:Boolean = true, onComplete:Function = null) : void
|
||||
{
|
||||
onFillEggsToStackComplete = onComplete;
|
||||
fillEggsToStack_para = {
|
||||
"sendEvent":sendEvent,
|
||||
"pushs":pushs
|
||||
};
|
||||
NetStack.getIns().pushEgg(pushs,fillEggsToStackHandler);
|
||||
}
|
||||
|
||||
private function fillEggsToStackHandler(gets:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var stackId:int = 0;
|
||||
var monster:MonsterVo = null;
|
||||
var j:int = 0;
|
||||
var push:Object = null;
|
||||
for(i = 0; i < gets.length; )
|
||||
{
|
||||
stackId = int(gets[i].stackId);
|
||||
monster = MonsterCenter.getMonByMonData(gets[i].monster);
|
||||
getStackById(stackId).monsterId = monster.id;
|
||||
MonsterCenter.getIns().getLocalMonster(monster);
|
||||
if(fillEggsToStack_para.sendEvent)
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_ADD_STACK,monster));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < fillEggsToStack_para.pushs.length; )
|
||||
{
|
||||
push = fillEggsToStack_para.pushs[j];
|
||||
BagCenter.getIns().subNum(push.itemId,1);
|
||||
j++;
|
||||
}
|
||||
fillEggsToStack_para = null;
|
||||
if(onFillEggsToStackComplete != null)
|
||||
{
|
||||
onFillEggsToStackComplete();
|
||||
onFillEggsToStackComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function autoFillEggToStack(mode:int = 1, onComplete:Function = null, eggvo:EggVo = null) : int
|
||||
{
|
||||
var eggs:Array = null;
|
||||
var k:int = 0;
|
||||
var eg:EggVo = null;
|
||||
var eggnum:int = 0;
|
||||
var j:int = 0;
|
||||
var count:int = 0;
|
||||
var pushs:Array = null;
|
||||
var numcountDic:Object = null;
|
||||
var eggflag:int = 0;
|
||||
var i:int = 0;
|
||||
onAutoFillEggToStackComplete = onComplete;
|
||||
if(autoFilling == false)
|
||||
{
|
||||
autoFilling = true;
|
||||
var emptyStack:Array = [];
|
||||
var isVip:Boolean = MasterCenter.getIns().getVipDay() > 0;
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
if(!(!isVip && s.position == 3))
|
||||
{
|
||||
if(s.isEmpty)
|
||||
{
|
||||
emptyStack.push(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(emptyStack.length > 0)
|
||||
{
|
||||
if(eggvo == null)
|
||||
{
|
||||
eggs = getAutoFillEggs(mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
eggs = [eggvo];
|
||||
}
|
||||
k = 0;
|
||||
while(k < eggs.length)
|
||||
{
|
||||
eg = eggs[k];
|
||||
if(eg.feedLock)
|
||||
{
|
||||
eggs.splice(k,1);
|
||||
k--;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
eggnum = 0;
|
||||
for(j = 0; j < eggs.length; )
|
||||
{
|
||||
eggnum += eggs[j].num;
|
||||
j++;
|
||||
}
|
||||
count = Math.min(eggnum,emptyStack.length);
|
||||
if(count == 0)
|
||||
{
|
||||
autoFilling = false;
|
||||
return 0;
|
||||
}
|
||||
pushs = [];
|
||||
numcountDic = {};
|
||||
eggflag = 0;
|
||||
for(i = 0; i < count; )
|
||||
{
|
||||
if(numcountDic[eggs[eggflag].id] != null && numcountDic[eggs[eggflag].id] >= eggs[eggflag].num)
|
||||
{
|
||||
eggflag++;
|
||||
}
|
||||
pushs.push({
|
||||
"itemId":eggs[eggflag].id,
|
||||
"stackId":emptyStack[i].id
|
||||
});
|
||||
if(numcountDic[eggs[eggflag].id] == null)
|
||||
{
|
||||
numcountDic[eggs[eggflag].id] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
numcountDic[eggs[eggflag].id]++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
fillEggsToStack(pushs,true,autoFillEggToStackHandler);
|
||||
return count;
|
||||
}
|
||||
autoFilling = false;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function autoFillEggToStackHandler() : void
|
||||
{
|
||||
autoFilling = false;
|
||||
if(onAutoFillEggToStackComplete != null)
|
||||
{
|
||||
onAutoFillEggToStackComplete();
|
||||
onAutoFillEggToStackComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function moveMonsToRoom(datas:Array, onComplete:Function) : void
|
||||
{
|
||||
onMoveMonsToRoomComplete = onComplete;
|
||||
moveMonsToRoom_datas = datas;
|
||||
NetStack.getIns().moveMonster(datas,moveMonsToRoomHandler);
|
||||
}
|
||||
|
||||
private function moveMonsToRoomHandler() : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var movedata:Object = null;
|
||||
var mids:Array = null;
|
||||
var roomId:int = 0;
|
||||
var i:int = 0;
|
||||
var mon:MonsterVo = null;
|
||||
for(j = 0; j < moveMonsToRoom_datas.length; )
|
||||
{
|
||||
movedata = moveMonsToRoom_datas[j];
|
||||
mids = movedata.monsterId;
|
||||
roomId = int(movedata.roomId);
|
||||
for each(var stackvo:StackVo in Master.stacks)
|
||||
{
|
||||
if(stackvo.monsterId != 0 && mids.indexOf(stackvo.monsterId) != -1)
|
||||
{
|
||||
stackvo.monsterId = 0;
|
||||
stackvo.atkNum = 0;
|
||||
stackvo.defNum = 0;
|
||||
stackvo.hpNum = 0;
|
||||
stackvo.dexNum = 0;
|
||||
}
|
||||
}
|
||||
for(i = 0; i < mids.length; )
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(mids[i]);
|
||||
mon.roomId = roomId;
|
||||
mon.process = 3;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_REMOVE_STACK,{
|
||||
"mon":mon,
|
||||
"type":"moveroom"
|
||||
}));
|
||||
i++;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
moveMonsToRoom_datas = null;
|
||||
if(onMoveMonsToRoomComplete != null)
|
||||
{
|
||||
onMoveMonsToRoomComplete();
|
||||
onMoveMonsToRoomComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function getAutoFillEggs(mode:int = 1) : Array
|
||||
{
|
||||
var eggs:Array = Master.bag.getEggArr();
|
||||
switch(mode)
|
||||
{
|
||||
case 0:
|
||||
eggs.sortOn("timeGet",0x10 | 2);
|
||||
break;
|
||||
case 1:
|
||||
eggs.sortOn("timeTotal",16);
|
||||
break;
|
||||
case 2:
|
||||
eggs.sortOn("timeTotal",0x10 | 2);
|
||||
break;
|
||||
case 3:
|
||||
eggs.sortOn("star",0x10 | 2);
|
||||
}
|
||||
return eggs;
|
||||
}
|
||||
|
||||
public function getMonsterCanFromStack() : Array
|
||||
{
|
||||
var mon:MonsterVo = null;
|
||||
var mons:Array = [];
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
if(!s.isEmpty)
|
||||
{
|
||||
mon = s.getMon();
|
||||
if(mon.mode == 2)
|
||||
{
|
||||
mons.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mons;
|
||||
}
|
||||
|
||||
public function getNewStackId() : int
|
||||
{
|
||||
return Game.getIns().master.stacks.length + 1;
|
||||
}
|
||||
|
||||
public function getStackById(sid:int) : StackVo
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < Master.stacks.length; )
|
||||
{
|
||||
if(Master.stacks[i].id == sid)
|
||||
{
|
||||
return Master.stacks[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getStackMonsters() : Array
|
||||
{
|
||||
var arr:Array = [];
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
if(s.monsterId > 0)
|
||||
{
|
||||
arr.push(MonsterCenter.getIns().getMonById(s.monsterId));
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function cleanLocalStackByMonId(mid:Number) : void
|
||||
{
|
||||
var mon:MonsterVo = null;
|
||||
for each(var s:StackVo in Master.stacks)
|
||||
{
|
||||
mon = s.getMon();
|
||||
if(s.monsterId == mid)
|
||||
{
|
||||
s.monsterId = 0;
|
||||
s.atkNum = 0;
|
||||
s.defNum = 0;
|
||||
s.hpNum = 0;
|
||||
s.dexNum = 0;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_REMOVE_STACK,{
|
||||
"mon":mon,
|
||||
"type":"task"
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.element.achi.AchiType;
|
||||
import net.pixvi.myr.element.battle.BattleData;
|
||||
import net.pixvi.myr.element.cost.CostVo;
|
||||
import net.pixvi.myr.element.explore.ExploreAreaVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.stage.StageVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetStage;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class StageCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onCheckLoopStageComplete:Function;
|
||||
|
||||
private var onGetStageRewardComplete:Function;
|
||||
|
||||
private var getStageOnceReward_stageRewardId:String;
|
||||
|
||||
private var onStartStageComplete:Function;
|
||||
|
||||
private var onFinishStageComplete:Function;
|
||||
|
||||
private var finishStageBattle_battleData:BattleData;
|
||||
|
||||
public function StageCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : StageCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(StageCenter) as StageCenter;
|
||||
}
|
||||
|
||||
public function checkLoopStage(onComplete:Function) : void
|
||||
{
|
||||
onCheckLoopStageComplete = onComplete;
|
||||
NetStage.getIns().checkLoopStage(checkLoopStageHandler);
|
||||
}
|
||||
|
||||
private function checkLoopStageHandler(re:Object) : void
|
||||
{
|
||||
var stages:Array = null;
|
||||
var i:int = 0;
|
||||
Master.activityHistory.getStageRewardTime = TimeCenter.timestamp;
|
||||
Master.activityHistory.stageRewardStatus = re.rewardIds;
|
||||
if(re.emptyData == true)
|
||||
{
|
||||
stages = Table.loopStage_info.weekLoopStages;
|
||||
for(i = 0; i < stages.length; )
|
||||
{
|
||||
Master.history.passStage[stages[i]] = {
|
||||
1:false,
|
||||
2:false,
|
||||
3:false
|
||||
};
|
||||
Master.history.unlockStage[stages[i]] = {
|
||||
1:false,
|
||||
2:false,
|
||||
3:false
|
||||
};
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(onCheckLoopStageComplete != null)
|
||||
{
|
||||
onCheckLoopStageComplete(re);
|
||||
onCheckLoopStageComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getStageOnceReward(stageRewardId:String, onComplete:Function) : void
|
||||
{
|
||||
onGetStageRewardComplete = onComplete;
|
||||
getStageOnceReward_stageRewardId = stageRewardId;
|
||||
NetStage.getIns().getStageReward(stageRewardId,getStageRewardHandler);
|
||||
}
|
||||
|
||||
private function getStageRewardHandler(re:Object) : void
|
||||
{
|
||||
RewardCenter.getIns().getRewardByData(re.reward,"true","panel");
|
||||
Master.activityHistory.stageRewardStatus.push(getStageOnceReward_stageRewardId);
|
||||
if(onGetStageRewardComplete != null)
|
||||
{
|
||||
onGetStageRewardComplete(re);
|
||||
onGetStageRewardComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function startStage(stageTypeId:String, stageLevel:String, onComplete:Function) : void
|
||||
{
|
||||
onStartStageComplete = onComplete;
|
||||
NetStage.getIns().startStage(stageTypeId,stageLevel,startStageHandler);
|
||||
}
|
||||
|
||||
private function startStageHandler(isEvent:Boolean, stageEvent:Object) : void
|
||||
{
|
||||
var rewardResult:RewardResultVo = null;
|
||||
if(isEvent)
|
||||
{
|
||||
if(stageEvent.hideStageId == null)
|
||||
{
|
||||
Alert.pauseMsg();
|
||||
rewardResult = RewardCenter.getIns().getRewardByData(stageEvent.result);
|
||||
if(stageEvent.costTi > 0)
|
||||
{
|
||||
MasterCenter.getIns().addTi(-stageEvent.costTi);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(onStartStageComplete != null)
|
||||
{
|
||||
onStartStageComplete(isEvent,rewardResult,stageEvent);
|
||||
onStartStageComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function finishStageBattle(battledata:BattleData, onComplete:Function) : void
|
||||
{
|
||||
onFinishStageComplete = onComplete;
|
||||
finishStageBattle_battleData = battledata;
|
||||
NetStage.getIns().finishStageBattle(battledata.getObj(),finishStageHandler);
|
||||
}
|
||||
|
||||
private function finishStageHandler(rewardData:Object, costTi:int, unlockStage:Array, lockStage:Array, monsterExp:Array) : void
|
||||
{
|
||||
StageCenter.getIns().passLocalStage(finishStageBattle_battleData.battlePosition.stageId,finishStageBattle_battleData.battlePosition.stageLevel,costTi,unlockStage,lockStage);
|
||||
StageCenter.getIns().lockLocalStages(lockStage);
|
||||
var rewardvo:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
if(onFinishStageComplete != null)
|
||||
{
|
||||
onFinishStageComplete(rewardvo,costTi,lockStage,monsterExp);
|
||||
onFinishStageComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function passLocalStage(stageid:String, level:String, costTi:int, unlockStages:Array, lockStages:Array) : Boolean
|
||||
{
|
||||
var area:ExploreAreaVo = null;
|
||||
var i:int = 0;
|
||||
var first:Boolean = false;
|
||||
var s:StageVo = new StageVo();
|
||||
s.id = stageid;
|
||||
MasterCenter.getIns().addTi(-costTi);
|
||||
var costvo:CostVo = s.costVo;
|
||||
if(costvo != null)
|
||||
{
|
||||
BagCenter.getIns().subLocalCost(s.costVo);
|
||||
}
|
||||
if(Master.history.passStage[stageid] == null)
|
||||
{
|
||||
Master.history.passStage[stageid] = {
|
||||
1:false,
|
||||
2:false,
|
||||
3:false
|
||||
};
|
||||
}
|
||||
if(Master.history.passStage[stageid][level] == false || Master.history.passStage[stageid][level] == null)
|
||||
{
|
||||
if(level == "1")
|
||||
{
|
||||
area = ExploreCenter.getIns().checkStage(stageid);
|
||||
if(area != null && Boolean(Master.history.openExplore))
|
||||
{
|
||||
Alert.showMsg(CP.task(lang("发现了新的可探索区域") + "【" + area.name() + "】!"),3000);
|
||||
}
|
||||
}
|
||||
if(CityCenter.getIns().getCity(s.city) != null && CityCenter.getIns().getCity(s.city).table().openHardModeStage == s.id)
|
||||
{
|
||||
Alert.showMsg(CP.task(lang("可以在该地区进行深入探索了!")),3000);
|
||||
}
|
||||
if(CityCenter.getIns().getCity(s.city) != null && CityCenter.getIns().getCity(s.city).table().openExtraModeStage == s.id)
|
||||
{
|
||||
Alert.showMsg(CP.task(lang("可以在该地区进行完全探索了!")),3000);
|
||||
}
|
||||
Master.history.passStage[stageid][level] = true;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.STAGE_UPDATE,{
|
||||
"stageid":stageid,
|
||||
"level":int(level)
|
||||
}));
|
||||
first = true;
|
||||
AchiCenter.getIns().autoCheck(AchiType.STAGE);
|
||||
AchiCenter.getIns().autoCheck(AchiType.STARS);
|
||||
AchiCenter.getIns().autoCheck(AchiType.STAGE_LEVELS);
|
||||
}
|
||||
if(!s.special && int(level) < 3)
|
||||
{
|
||||
unlockStage(stageid,int(level) + 1);
|
||||
}
|
||||
if(unlockStages != null && unlockStages.length > 0)
|
||||
{
|
||||
for(i = 0; i < unlockStages.length; )
|
||||
{
|
||||
unlockStage(unlockStages[i],1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
lockLocalStages(lockStages);
|
||||
return first;
|
||||
}
|
||||
|
||||
public function unlockStage(stageid:String, level:int = 1, show:Boolean = false) : Boolean
|
||||
{
|
||||
if(stageid == "")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(Master.history.unlockStage[stageid] == null)
|
||||
{
|
||||
if(show && !Table.stage_info[stageid].special)
|
||||
{
|
||||
Alert.showMsg(lang("发现了新地点:") + Table.stage_info[stageid].name + Table.stage_info[stageid].tagname);
|
||||
}
|
||||
Master.history.unlockStage[stageid] = {
|
||||
"stageid":stageid,
|
||||
1:false,
|
||||
2:false,
|
||||
3:false
|
||||
};
|
||||
}
|
||||
if(!Master.history.unlockStage[stageid][level])
|
||||
{
|
||||
Master.history.unlockStage[stageid][level] = true;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.STAGE_UPDATE,{
|
||||
"stageid":stageid,
|
||||
"level":level
|
||||
}));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function unlockLocalStages(stages:Array, show:Boolean = false) : void
|
||||
{
|
||||
if(stages != null && stages.length > 0)
|
||||
{
|
||||
for each(var key:String in stages)
|
||||
{
|
||||
unlockStage(key,1,show);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function lockLocalStages(stages:Array) : void
|
||||
{
|
||||
if(stages != null && stages.length > 0)
|
||||
{
|
||||
for each(var key:String in stages)
|
||||
{
|
||||
delete Master.history.unlockStage[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getStageBattle(stageid:String, level:String) : Object
|
||||
{
|
||||
return Table.stage_info[stageid].level[level].battle;
|
||||
}
|
||||
|
||||
public function getStageReward(stageid:String, level:String) : Object
|
||||
{
|
||||
return Table.stage_info[stageid].level[level].reward;
|
||||
}
|
||||
|
||||
public function getStage(stageid:String) : StageVo
|
||||
{
|
||||
var stagevo:StageVo = null;
|
||||
if(Table.stage_info[stageid] != null)
|
||||
{
|
||||
stagevo = new StageVo();
|
||||
stagevo.id = stageid;
|
||||
return stagevo;
|
||||
}
|
||||
Alert.showMsg("can\'t find stage[" + stageid + "]");
|
||||
return null;
|
||||
}
|
||||
|
||||
public function countStars(city:int = -1) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var num:int = 0;
|
||||
var s:StageVo = new StageVo();
|
||||
for(var id:String in Master.history.passStage)
|
||||
{
|
||||
for(i = 1; i < 4; )
|
||||
{
|
||||
s.id = id;
|
||||
if(s.table() == null)
|
||||
{
|
||||
Alert.yes("error","找不到 关卡数据[" + s.id + "]");
|
||||
}
|
||||
else if(!s.special && Master.history.passStage[id][i] == true && (city == -1 || city == s.city))
|
||||
{
|
||||
trace(id,i);
|
||||
num++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public function isStageUnlock(stageid:String) : Boolean
|
||||
{
|
||||
if(Master.history.unlockStage[stageid] == null || Master.history.unlockStage[stageid]["1"] != true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isStagePass(stageid:String, level:int = 1) : Boolean
|
||||
{
|
||||
if(Master.history.passStage[stageid] != null && Master.history.passStage[stageid][level] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class StatusCenter extends Singleton
|
||||
{
|
||||
|
||||
public function StatusCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : StatusCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(StatusCenter) as StatusCenter;
|
||||
}
|
||||
|
||||
public function killMonster(type:int, mode:int) : void
|
||||
{
|
||||
if(Master.history.numKillMonsters[type] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[type] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.numKillMonsters[type]++;
|
||||
}
|
||||
}
|
||||
|
||||
public function getMonster(type:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function monsterModeChange(type:int, mode:int) : void
|
||||
{
|
||||
if(mode == 2)
|
||||
{
|
||||
if(Master.history.numFeedMonsters[type] == null)
|
||||
{
|
||||
Master.history.numFeedMonsters[type] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Master.history.numFeedMonsters[type]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function unlockMonster(type:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function passStage(stage:String, level:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function passLevel(level:int) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,440 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.manager.resource.RM;
|
||||
import net.pixvi.myr.element.bag.EquipBuildVo;
|
||||
import net.pixvi.myr.element.bag.ItemType;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.npc.PositionNPC;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.element.stage.StageVo;
|
||||
import net.pixvi.myr.net.NetCenter;
|
||||
import net.pixvi.myr.panel.login.LoginBg;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.ObjectUtil;
|
||||
import net.pixvi.pfw.utils.debug.CT;
|
||||
import net.pixvi.pse.file.FileTools;
|
||||
|
||||
public class Table
|
||||
{
|
||||
|
||||
public static var setting:Object;
|
||||
|
||||
public static var game_setting:Object;
|
||||
|
||||
public static var farm_level:Object;
|
||||
|
||||
public static var monster_info:Object;
|
||||
|
||||
public static var monster_infoArr:Array;
|
||||
|
||||
public static var monster_level:Object;
|
||||
|
||||
public static var monster_fix:Object;
|
||||
|
||||
public static var stack_price:Object;
|
||||
|
||||
public static var stack_info:Object;
|
||||
|
||||
public static var alchemyStack_price:Object;
|
||||
|
||||
public static var team_info:Object;
|
||||
|
||||
public static var monster_group:Object;
|
||||
|
||||
public static var monster_element:Object;
|
||||
|
||||
public static var monster_skill:Object;
|
||||
|
||||
public static var monster_setting:Object;
|
||||
|
||||
public static var city_info:Object;
|
||||
|
||||
public static var stage_info:Object;
|
||||
|
||||
public static var task_info:Object;
|
||||
|
||||
public static var gacha_machine:Object;
|
||||
|
||||
public static var item_info:Object;
|
||||
|
||||
public static var room_info:Object;
|
||||
|
||||
public static var room_info_arr:Object;
|
||||
|
||||
public static var room_price:Object;
|
||||
|
||||
public static var diary_info:Object;
|
||||
|
||||
public static var event_info:Object;
|
||||
|
||||
public static var event_table:Object;
|
||||
|
||||
public static var achi_info:Object;
|
||||
|
||||
public static var achi_infoArr:Array;
|
||||
|
||||
public static var looptask_info:Object;
|
||||
|
||||
public static var loopStage_info:Object;
|
||||
|
||||
public static var activity_info:Object;
|
||||
|
||||
public static var npc_info:Object;
|
||||
|
||||
public static var npc_position:Array;
|
||||
|
||||
public static var equipbuild_list:Array;
|
||||
|
||||
public static var explore_info:Object;
|
||||
|
||||
public static var explore_text:Object;
|
||||
|
||||
public static var potential_info:Object;
|
||||
|
||||
public static var pay_info:Object;
|
||||
|
||||
public static var pay_infoArr:Array;
|
||||
|
||||
public static var payGift_info:Object;
|
||||
|
||||
public static var payGift_infoArr:Array;
|
||||
|
||||
public static var entangle_info:Object;
|
||||
|
||||
public static var entangle_skill:Object;
|
||||
|
||||
public static var mine_info:Object;
|
||||
|
||||
public static var build_info:Object;
|
||||
|
||||
public static var exchange_info:Object;
|
||||
|
||||
public static var exchange_infoArr:Array;
|
||||
|
||||
public static var dazao_info:Object;
|
||||
|
||||
public static var tjchannel:Object;
|
||||
|
||||
public static var server_info:Object;
|
||||
|
||||
public static var avatar_info:Object;
|
||||
|
||||
public static var avatar_infoArr:Array;
|
||||
|
||||
public static var pve_info:Object;
|
||||
|
||||
public static var channel_tag:Object;
|
||||
|
||||
public static var pve_bot:Array;
|
||||
|
||||
public static var stage_sp:Object;
|
||||
|
||||
public static var shop_info:Object;
|
||||
|
||||
public static var boss_info:Object;
|
||||
|
||||
public static var skin_info:Object;
|
||||
|
||||
public static var mini_game:Object;
|
||||
|
||||
public static var game_config:Object;
|
||||
|
||||
public static var area_info:Object;
|
||||
|
||||
public static var chargeReward_info:Object;
|
||||
|
||||
public static var upstar_info:Object;
|
||||
|
||||
public function Table()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function startUp() : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var i:int = 0;
|
||||
var npcPositionVo:PositionNPC = null;
|
||||
CT.scan();
|
||||
Table.setting = RM.TXT.getJson("setting");
|
||||
Table.game_setting = RM.TXT.getJson("game_setting");
|
||||
Table.farm_level = RM.TXT.getJson("farm_level").datas;
|
||||
Table.monster_info = RM.TXT.getJson("monster_info").datas;
|
||||
Table.monster_infoArr = ObjectUtil.tableToArray(Table.monster_info,"sort",0,true,"montype");
|
||||
Table.monster_skill = RM.TXT.getJson("monster_skill").datas;
|
||||
Table.monster_setting = RM.TXT.getJson("monster_setting");
|
||||
Table.monster_group = monster_setting.group;
|
||||
Table.monster_element = monster_setting.element;
|
||||
Table.monster_level = RM.TXT.getJson("monster_level").datas;
|
||||
var stackTable:Object = RM.TXT.getJson("stack_price");
|
||||
Table.stack_price = stackTable.datas;
|
||||
Table.stack_info = stackTable;
|
||||
Table.alchemyStack_price = stackTable.alchemyDatas;
|
||||
Table.team_info = RM.TXT.getJson("team_info");
|
||||
Table.city_info = Table.game_setting.cityInfo;
|
||||
CT.scan();
|
||||
var stagearr:Array = RM.TXT.getJson("stage_info").datas;
|
||||
CT.scan("json消耗");
|
||||
Table.stage_info = ObjectUtil.tableToObject(stagearr);
|
||||
Table.item_info = RM.TXT.getJson("item_info").datas;
|
||||
Table.room_info = RM.TXT.getJson("room_info").datas;
|
||||
Table.room_info_arr = ObjectUtil.tableToArray(room_info,"",0,true,"type");
|
||||
Table.room_price = RM.TXT.getJson("room_price").datas;
|
||||
Table.task_info = RM.TXT.getJson("task_info").datas;
|
||||
Table.achi_info = RM.TXT.getJson("achi_info").datas;
|
||||
Table.achi_infoArr = ObjectUtil.tableToArray(achi_info,"",0,true,"id");
|
||||
Table.diary_info = RM.TXT.getJson("diary_info");
|
||||
(Table.diary_info.cgs as Array).sortOn("sort",16);
|
||||
(Table.diary_info.storys as Array).sortOn("sort",16);
|
||||
for(j = 0; j < Table.diary_info.storys.length; )
|
||||
{
|
||||
Table.diary_info.storys[j].sort = j + 1;
|
||||
j++;
|
||||
}
|
||||
Table.looptask_info = RM.TXT.getJson("looptask_info").citys;
|
||||
Table.activity_info = RM.TXT.getJson("activity_info");
|
||||
Table.gacha_machine = ObjectUtil.tableToObject(RM.TXT.getJson("gacha_machine").datas,"id");
|
||||
var npcInfo:Object = RM.TXT.getJson("npc_info");
|
||||
Table.npc_info = npcInfo.datas;
|
||||
Table.npc_position = [];
|
||||
var npc_positionData:Array = npcInfo.positionNpc;
|
||||
for(i = 0; i < npc_positionData.length; )
|
||||
{
|
||||
npcPositionVo = new PositionNPC();
|
||||
npcPositionVo.ondata(npc_positionData[i]);
|
||||
Table.npc_position.push(npcPositionVo);
|
||||
i++;
|
||||
}
|
||||
Table.event_info = RM.TXT.getJson("event_info");
|
||||
Table.entangle_info = RM.TXT.getJson("entangle_info");
|
||||
Table.entangle_skill = Table.entangle_info.entangleSkill;
|
||||
Table.event_table = {};
|
||||
for each(var farmevent:Object in Table.event_info.farmEvents)
|
||||
{
|
||||
Table.event_table[farmevent.typeId] = farmevent;
|
||||
}
|
||||
Mapper.fillVariables(Table.event_table,Table.event_table.monEvents,false);
|
||||
for each(var exploreEvent:Object in Table.event_info.stageEvents)
|
||||
{
|
||||
Table.event_table[exploreEvent.typeId] = exploreEvent;
|
||||
}
|
||||
Table.explore_info = RM.TXT.getJson("explore_info").areas;
|
||||
Table.explore_text = RM.TXT.getJson("explore_text").datas;
|
||||
GameTools.words = RM.TXT.getTxt("words").split(",");
|
||||
if(setting.addWords != null)
|
||||
{
|
||||
GameTools.words = GameTools.words.concat(setting.addWords);
|
||||
}
|
||||
Table.potential_info = RM.TXT.getJson("potential_info");
|
||||
Table.equipbuild_list = makeBuildList();
|
||||
Table.pay_info = RM.TXT.getJson("pay_info").datas;
|
||||
Table.pay_infoArr = ObjectUtil.tableToArray(Table.pay_info,"id");
|
||||
Table.payGift_info = RM.TXT.getJson("payGift_info").datas;
|
||||
Table.payGift_infoArr = ObjectUtil.tableToArray(Table.payGift_info,"id");
|
||||
Table.mine_info = RM.TXT.getJson("mine_info");
|
||||
var exchangeObj:Object = RM.TXT.getJson("item_exchange_info");
|
||||
Table.exchange_info = exchangeObj.datas;
|
||||
Table.exchange_infoArr = ObjectUtil.tableToArray(Table.exchange_info,"id",16);
|
||||
Table.dazao_info = exchangeObj.dazao;
|
||||
Table.build_info = RM.TXT.getJson("build_info");
|
||||
if(RM.TXT.getJson("tjchannel") != null)
|
||||
{
|
||||
Table.tjchannel = RM.TXT.getJson("tjchannel");
|
||||
}
|
||||
else
|
||||
{
|
||||
Table.tjchannel = {"tjchannel":"unknow"};
|
||||
}
|
||||
Table.server_info = RM.TXT.getJson("server_info");
|
||||
LoginBg.getIns().trace("11%");
|
||||
Table.avatar_infoArr = RM.TXT.getJson("avatar_info").datas;
|
||||
Table.avatar_info = ObjectUtil.tableToObject(Table.avatar_infoArr,"avatarId");
|
||||
Table.pve_info = RM.TXT.getJson("pve_info");
|
||||
if(FileTools.applicationDirectory.resolvePath("channel_tag.json").exists)
|
||||
{
|
||||
Table.channel_tag = FileTools.readFileObject(FileTools.applicationDirectory.resolvePath("channel_tag.json"));
|
||||
}
|
||||
var shopdata:Object = RM.TXT.getJson("shop_info");
|
||||
var shoparr:Array = shopdata.keShopList;
|
||||
shoparr = shoparr.concat(shopdata.mustBeMoneyShopList);
|
||||
shoparr = shoparr.concat(shopdata.moneyShopList);
|
||||
if(shopdata.removeShopList != null)
|
||||
{
|
||||
shoparr = shoparr.concat(shopdata.removeShopList);
|
||||
}
|
||||
shop_info = ObjectUtil.tableToObject(shoparr);
|
||||
pve_bot = RM.TXT.getJson("pve_bot").datas;
|
||||
LoginBg.getIns().trace("12%");
|
||||
LoginBg.getIns().trace("13%");
|
||||
Table.stage_sp = RM.TXT.getJson("stage_sp").datas;
|
||||
Table.boss_info = RM.TXT.getJson("boss_info").boss;
|
||||
Table.area_info = RM.TXT.getJson("area_info");
|
||||
skin_info = RM.TXT.getJson("skin_info").skins;
|
||||
if(RM.TXT.hasResource("mini_game"))
|
||||
{
|
||||
mini_game = RM.TXT.getJson("mini_game").miniGameCfg;
|
||||
}
|
||||
if(RM.TXT.hasResource("chargeReward_info"))
|
||||
{
|
||||
chargeReward_info = RM.TXT.getJson("chargeReward_info").datas;
|
||||
}
|
||||
if(Table.game_setting.xyz1 != null)
|
||||
{
|
||||
NetCenter.netkey = Table.game_setting.xyz1;
|
||||
}
|
||||
if(RM.TXT.hasResource("loopStage_info"))
|
||||
{
|
||||
loopStage_info = RM.TXT.getJson("loopStage_info");
|
||||
}
|
||||
else
|
||||
{
|
||||
loopStage_info = {};
|
||||
}
|
||||
if(RM.TXT.hasResource("upstar_info"))
|
||||
{
|
||||
upstar_info = RM.TXT.getJson("upstar_info");
|
||||
}
|
||||
else
|
||||
{
|
||||
upstar_info = {};
|
||||
}
|
||||
makeAvatarTable();
|
||||
CT.scan("table");
|
||||
}
|
||||
|
||||
private static function makeAvatarTable() : void
|
||||
{
|
||||
var jbavatar:Object = null;
|
||||
var pfavatar:Object = null;
|
||||
for each(var mondata:Object in Table.monster_infoArr)
|
||||
{
|
||||
if(!mondata.hideLib && mondata.pifu != true)
|
||||
{
|
||||
jbavatar = {
|
||||
"avatarId":mondata.type,
|
||||
"type":"entangle",
|
||||
"img":ImgCenter.getMonAvatar(mondata.type)
|
||||
};
|
||||
Table.avatar_info[mondata.type] = jbavatar;
|
||||
Table.avatar_infoArr.push(jbavatar);
|
||||
}
|
||||
}
|
||||
for each(var skindata:Object in Table.skin_info)
|
||||
{
|
||||
pfavatar = {
|
||||
"avatarId":skindata.typeId,
|
||||
"type":"skin",
|
||||
"img":ImgCenter.getMonAvatar(skindata.typeId)
|
||||
};
|
||||
Table.avatar_info[skindata.typeId] = pfavatar;
|
||||
Table.avatar_infoArr.push(pfavatar);
|
||||
}
|
||||
}
|
||||
|
||||
private static function makeBuildList() : Array
|
||||
{
|
||||
var exp:EquipBuildVo = null;
|
||||
var o2:Object = null;
|
||||
var exps:Array = [];
|
||||
for each(var item:Object in Table.item_info)
|
||||
{
|
||||
if(item.itemType == ItemType.TYPE_EQUIP && item.canAlchemy)
|
||||
{
|
||||
exp = new EquipBuildVo();
|
||||
exp.chance = item.chance;
|
||||
exp.core = ObjectUtil.deepClone(item.buildCore);
|
||||
exp.material = ObjectUtil.deepClone(item.buildMaterial);
|
||||
exp.type = item.type;
|
||||
for each(var o:Object in exp.core)
|
||||
{
|
||||
for each(var mat:Object in Table.item_info[o.name].material)
|
||||
{
|
||||
o2 = ArrayUtil.getElementByValue(exp.material,"name",mat.name);
|
||||
if(o2 == null)
|
||||
{
|
||||
exp.material.push({
|
||||
"name":mat.name,
|
||||
"value":int(mat.value)
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
o2.value += int(mat.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
exps.push(exp);
|
||||
}
|
||||
}
|
||||
return exps;
|
||||
}
|
||||
|
||||
private static function makeDropTable() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var stagevo:StageVo = null;
|
||||
var reward:RewardVo = null;
|
||||
var res:Array = null;
|
||||
CT.scan();
|
||||
var items:Array = ObjectUtil.tableToArray(item_info,"",0,false,"type");
|
||||
var stages:Array = ObjectUtil.tableToArray(stage_info,"",0,false,"id");
|
||||
stages.sortOn("id");
|
||||
var levelname:Object = {
|
||||
"0":"初步探索",
|
||||
"1":"深入探索",
|
||||
"2":"完全探索"
|
||||
};
|
||||
for each(var item:Object in items)
|
||||
{
|
||||
if(item.from != null && item.from != "")
|
||||
{
|
||||
item.from = "获取:" + item.from;
|
||||
}
|
||||
else if(item.itemType != ItemType.TYPE_EQUIP)
|
||||
{
|
||||
loop1:
|
||||
for each(var stageVo:Object in stages)
|
||||
{
|
||||
if(!stageVo.special)
|
||||
{
|
||||
i = 0;
|
||||
while(i < 3)
|
||||
{
|
||||
stagevo = new StageVo();
|
||||
stagevo.id = stageVo.id;
|
||||
reward = stagevo.getRewardVo(i + 1);
|
||||
res = reward.getAllRewardList();
|
||||
if(reward != null)
|
||||
{
|
||||
for each(var revo:ItemVo in res)
|
||||
{
|
||||
if(revo.type == item.type)
|
||||
{
|
||||
item.from = "获取:" + stageVo.tagname + levelname[i];
|
||||
break loop1;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(item.from == null && item.itemType == ItemType.TYPE_EGG)
|
||||
{
|
||||
item.from = "";
|
||||
}
|
||||
if(item.from == null)
|
||||
{
|
||||
item.from = "获取:未知";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
item.from = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,881 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.CP;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.bag.ItemVo;
|
||||
import net.pixvi.myr.element.city.CityVo;
|
||||
import net.pixvi.myr.element.guide.GSub;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardResultVo;
|
||||
import net.pixvi.myr.element.task.TaskStatusType;
|
||||
import net.pixvi.myr.element.task.TaskType;
|
||||
import net.pixvi.myr.element.task.TaskVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetTask;
|
||||
import net.pixvi.myr.panel.gacha.GachaPanel;
|
||||
import net.pixvi.myr.panel.looptask.LoopTaskPanel;
|
||||
import net.pixvi.myr.util.MyrCalendar;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class TaskCenter
|
||||
{
|
||||
|
||||
private var finishTask_tid:int;
|
||||
|
||||
private var finishTask_type:String;
|
||||
|
||||
private var onFinishTaskComplete:Function;
|
||||
|
||||
private var openCityName:String;
|
||||
|
||||
private var onCompleteStepComplete:Function;
|
||||
|
||||
private var completeStep_para:Object;
|
||||
|
||||
private var receiveTask_task:TaskVo;
|
||||
|
||||
private var receiveTask_show:Boolean;
|
||||
|
||||
private var onReceiveTaskComplete:Function;
|
||||
|
||||
private var resetingLoopTask:Boolean = false;
|
||||
|
||||
private var onResetLoopTaskComplete:Function;
|
||||
|
||||
private var onGetLoopTaskComplete:Function;
|
||||
|
||||
private var getLoopTask_para:Object;
|
||||
|
||||
public function TaskCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getTaskByTaskData(taskData:Object) : TaskVo
|
||||
{
|
||||
var taskVo:TaskVo = new TaskVo();
|
||||
taskVo.id = taskData.id;
|
||||
taskVo.typeId = taskData.typeId;
|
||||
taskVo.step = taskData.curStep - 1;
|
||||
taskVo.stepVo = taskVo.getStepVo(taskVo.step);
|
||||
taskVo.stepValue = taskData.stepValue;
|
||||
taskVo.recieved = true;
|
||||
return taskVo;
|
||||
}
|
||||
|
||||
public static function getIns() : TaskCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(TaskCenter) as TaskCenter;
|
||||
}
|
||||
|
||||
public function autoCheckNewTask(unlocks:Array = null) : void
|
||||
{
|
||||
var checkDatas:Object = null;
|
||||
var startTask:String = "1001001";
|
||||
if(Table.setting.useOldNewTaskFunction == true)
|
||||
{
|
||||
checkDatas = checkPassTasksNewTask(startTask);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkDatas = checkNewTask();
|
||||
}
|
||||
var needGetTasks:Array = checkDatas.getNewTaskTypes;
|
||||
var needUnlockTasks:Array = checkDatas.unlockNewTaskTypes;
|
||||
var needRemoveTasks:Array = checkDatas.removeTaskIds;
|
||||
if(unlocks != null)
|
||||
{
|
||||
needUnlockTasks = unlocks;
|
||||
}
|
||||
NetTask.getIns().updateTask(needUnlockTasks,needGetTasks,needRemoveTasks,autoCheckNewTaskHandler);
|
||||
}
|
||||
|
||||
public function autoCheckNewTaskHandler(unlockTasks:Array, receiveTasks:Array) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var unlockTaskTypeId:String = null;
|
||||
var k:int = 0;
|
||||
var tv:TaskVo = null;
|
||||
for(i = 0; i < receiveTasks.length; )
|
||||
{
|
||||
addLocalTask(TaskCenter.getTaskByTaskData(receiveTasks[i]));
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < unlockTasks.length; )
|
||||
{
|
||||
unlockTaskTypeId = unlockTasks[j];
|
||||
unlockLocalTask(unlockTaskTypeId);
|
||||
j++;
|
||||
}
|
||||
for(k = 0; k < Master.tasks.length; )
|
||||
{
|
||||
tv = Master.tasks[k];
|
||||
if(tv.closed == true)
|
||||
{
|
||||
Master.tasks.splice(k,1);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
private function checkNewTask() : Object
|
||||
{
|
||||
var passTaskObject:Object = null;
|
||||
var nextTasks:Array = null;
|
||||
var unlockTasks:Array = null;
|
||||
var i:int = 0;
|
||||
var unlockTaskclose:Boolean = false;
|
||||
var j:int = 0;
|
||||
var nextTaskclose:Boolean = false;
|
||||
var getNewTaskTypes:Array = [];
|
||||
var unlockNewTaskTypes:Array = [];
|
||||
var removeTaskIds:Array = [];
|
||||
for(var taskKey:String in Master.history.passTask)
|
||||
{
|
||||
passTaskObject = Table.task_info[taskKey];
|
||||
if(passTaskObject == null)
|
||||
{
|
||||
if(GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("can\'t find task[" + taskKey + "]");
|
||||
}
|
||||
}
|
||||
else if(!passTaskObject.closed)
|
||||
{
|
||||
nextTasks = passTaskObject.nextTasks;
|
||||
unlockTasks = passTaskObject.unlockTasks;
|
||||
for(i = 0; i < unlockTasks.length; )
|
||||
{
|
||||
unlockTaskclose = false;
|
||||
if(Table.task_info[unlockTasks[i]] != null && Table.task_info[unlockTasks[i]].closed)
|
||||
{
|
||||
unlockTaskclose = true;
|
||||
}
|
||||
if(!unlockTaskclose && Master.history.unlockTask[unlockTasks[i]] != true && unlockNewTaskTypes.indexOf(unlockTasks[i]) == -1)
|
||||
{
|
||||
unlockNewTaskTypes.push({
|
||||
"prev":taskKey,
|
||||
"taskTypeId":unlockTasks[i]
|
||||
});
|
||||
trace("新任务解锁:" + unlockTasks[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < nextTasks.length; )
|
||||
{
|
||||
nextTaskclose = false;
|
||||
if(Table.task_info[nextTasks[j]] != null && Table.task_info[nextTasks[j]].closed)
|
||||
{
|
||||
nextTaskclose = true;
|
||||
}
|
||||
if(!nextTaskclose && Master.history.passTask[nextTasks[j]] != true && TaskCenter.getIns().getTaskByType(nextTasks[j]) == null)
|
||||
{
|
||||
getNewTaskTypes.push({
|
||||
"prev":taskKey,
|
||||
"taskTypeId":nextTasks[j]
|
||||
});
|
||||
trace("新任务获取:" + nextTasks[j]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for each(var tv:TaskVo in Master.tasks)
|
||||
{
|
||||
if(tv.closed == true)
|
||||
{
|
||||
removeTaskIds.push(tv.id);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"getNewTaskTypes":getNewTaskTypes,
|
||||
"unlockNewTaskTypes":unlockNewTaskTypes,
|
||||
"removeTaskIds":removeTaskIds
|
||||
};
|
||||
}
|
||||
|
||||
private function checkPassTasksNewTask(taskTypeId:String) : Object
|
||||
{
|
||||
var i:int = 0;
|
||||
var nextTaskType:String = null;
|
||||
var checkDatas:Object = null;
|
||||
var j:int = 0;
|
||||
var unlockTaskType:String = null;
|
||||
trace("开始检测:" + taskTypeId);
|
||||
if(Master.history.passTask[taskTypeId] != true)
|
||||
{
|
||||
trace(taskTypeId + "未通过");
|
||||
return {
|
||||
"getNewTaskTypes":[],
|
||||
"unlockNewTaskTypes":[]
|
||||
};
|
||||
}
|
||||
var getNewTaskTypes:Array = [];
|
||||
var unlockNewTaskTypes:Array = [];
|
||||
var nextTasks:Array = Table.task_info[taskTypeId].nextTasks;
|
||||
var unlockTasks:Array = Table.task_info[taskTypeId].unlockTasks;
|
||||
for(i = 0; i < nextTasks.length; )
|
||||
{
|
||||
nextTaskType = nextTasks[i];
|
||||
trace("检测" + taskTypeId + "关联:",nextTaskType);
|
||||
if(Master.history.passTask[nextTaskType] != true && TaskCenter.getIns().getTaskByType(nextTaskType) == null)
|
||||
{
|
||||
getNewTaskTypes.push({
|
||||
"prev":taskTypeId,
|
||||
"taskTypeId":nextTaskType
|
||||
});
|
||||
trace("检测" + taskTypeId + "关联:",nextTaskType,"补充获取!!!!!!");
|
||||
}
|
||||
else if(Master.history.passTask[nextTaskType] == true)
|
||||
{
|
||||
trace("检测" + taskTypeId + "关联:",nextTaskType,"检查");
|
||||
checkDatas = checkPassTasksNewTask(nextTaskType);
|
||||
getNewTaskTypes = getNewTaskTypes.concat(checkDatas.getNewTaskTypes);
|
||||
unlockNewTaskTypes = unlockNewTaskTypes.concat(checkDatas.unlockNewTaskTypes);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
for(j = 0; j < unlockTasks.length; )
|
||||
{
|
||||
unlockTaskType = unlockTasks[j];
|
||||
trace("检测" + taskTypeId + "解锁关联:",unlockTaskType);
|
||||
if(Master.history.unlockTask[unlockTaskType] != true)
|
||||
{
|
||||
trace("检测" + taskTypeId + "解锁关联:",unlockTaskType,"需解锁!!!!");
|
||||
unlockNewTaskTypes.push({
|
||||
"prev":taskTypeId,
|
||||
"taskTypeId":unlockTaskType
|
||||
});
|
||||
}
|
||||
j++;
|
||||
}
|
||||
return {
|
||||
"getNewTaskTypes":getNewTaskTypes,
|
||||
"unlockNewTaskTypes":unlockNewTaskTypes
|
||||
};
|
||||
}
|
||||
|
||||
public function finishTask(tid:int, tasktypeId:String, onComplete:Function) : void
|
||||
{
|
||||
onFinishTaskComplete = onComplete;
|
||||
finishTask_tid = tid;
|
||||
finishTask_type = tasktypeId;
|
||||
NetTask.getIns().finishTask(tid,tasktypeId,finishTaskHandler);
|
||||
}
|
||||
|
||||
private function finishTaskHandler(rewardData:Object, taskdatas:Array, unlockTasks:Array, unlockStages:Array) : void
|
||||
{
|
||||
var j:int = 0;
|
||||
var newTask:TaskVo = null;
|
||||
var k:int = 0;
|
||||
var task:TaskVo = getTaskById(finishTask_tid);
|
||||
var rewardResultVo:RewardResultVo = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
task.complete = true;
|
||||
ArrayUtil.remove(Master.tasks,task);
|
||||
Master.history.passTask[task.typeId] = true;
|
||||
RewardCenter.getIns().getReward(rewardResultVo,true,"panel",showOpenCity);
|
||||
if(task.type == TaskType.LOOP_TASK)
|
||||
{
|
||||
LoopTaskPanel.getIns().update();
|
||||
}
|
||||
if(taskdatas != null && taskdatas.length > 0)
|
||||
{
|
||||
for(j = 0; j < taskdatas.length; )
|
||||
{
|
||||
newTask = TaskCenter.getTaskByTaskData(taskdatas[j]);
|
||||
Master.tasks.push(newTask);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if(unlockTasks != null && unlockTasks.length > 0)
|
||||
{
|
||||
for(k = 0; k < unlockTasks.length; )
|
||||
{
|
||||
TaskCenter.getIns().unlockLocalTask(unlockTasks[k]);
|
||||
k++;
|
||||
}
|
||||
}
|
||||
if(unlockStages != null && unlockStages.length > 0)
|
||||
{
|
||||
for each(var s:String in unlockStages)
|
||||
{
|
||||
StageCenter.getIns().unlockStage(s,1,true);
|
||||
}
|
||||
}
|
||||
for each(var o:Object in Table.city_info)
|
||||
{
|
||||
if(task.typeId == o.openTask)
|
||||
{
|
||||
Master.history.unlockCity[o.cid] = true;
|
||||
openCityName = o.name;
|
||||
}
|
||||
}
|
||||
Master.history.passTask[task.typeId] = true;
|
||||
if(onFinishTaskComplete != null)
|
||||
{
|
||||
onFinishTaskComplete();
|
||||
onFinishTaskComplete = null;
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
}
|
||||
|
||||
private function showOpenCity() : void
|
||||
{
|
||||
var entangleMon:MonsterVo = null;
|
||||
if(openCityName != null)
|
||||
{
|
||||
Alert.yes(lang("通关区域"),CP.task(lang("新地区【{0}】开启了!",openCityName)));
|
||||
openCityName = null;
|
||||
}
|
||||
for(var monType:String in Table.upstar_info)
|
||||
{
|
||||
if(Table.upstar_info[monType].task != null && Table.upstar_info[monType].task.indexOf(finishTask_type) >= 0)
|
||||
{
|
||||
entangleMon = MonsterCenter.getIns().getEntangleMonByType(int(monType));
|
||||
if(entangleMon != null)
|
||||
{
|
||||
Alert.yes(lang("升星契机"),CP.task(lang("完成了与【{0}】的升星契机!可前往羁绊界面解锁升星。",entangleMon.desName)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function completeLocalStep(task:TaskVo) : void
|
||||
{
|
||||
if(task.stepVo.unlockStages.length > 0)
|
||||
{
|
||||
for each(var s:String in task.stepVo.unlockStages)
|
||||
{
|
||||
StageCenter.getIns().unlockStage(s,1,true);
|
||||
}
|
||||
}
|
||||
if(task.typeId == "1001006" && task.step == 3)
|
||||
{
|
||||
Caller.delayCall(GachaPanel.popInGacha,200,1,["task1"]);
|
||||
}
|
||||
task.step++;
|
||||
if(task.steps[task.step] == null)
|
||||
{
|
||||
task.stepVo = null;
|
||||
Alert.showMsg(lang("任务 {0} 完成!",CP.task(task.name)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.showMsg(lang("任务 {0} 有更新!",CP.task(task.name)));
|
||||
task.stepVo = task.getStepVo();
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
}
|
||||
|
||||
public function finishStep(t:TaskVo, showReward:Boolean = false, onComplete:Function = null) : void
|
||||
{
|
||||
var removeIds:Array = null;
|
||||
onCompleteStepComplete = onComplete;
|
||||
switch(t.stepVo.statusType)
|
||||
{
|
||||
case TaskStatusType.GET_ITEM:
|
||||
removeIds = BagCenter.getIns().getIdsByType(t.stepVo.statusValue.type,t.stepVo.statusValue.num);
|
||||
break;
|
||||
case TaskStatusType.GET_MONSTER:
|
||||
if(int(t.stepVo.statusValue.mode) == 0)
|
||||
{
|
||||
removeIds = BagCenter.getIns().getIdsByType(t.stepVo.statusValue.type,t.stepVo.statusValue.num);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeIds = MonsterCenter.getIns().getTaskMonsterMode2(t.stepVo.statusValue.type,t.stepVo.statusValue.num);
|
||||
}
|
||||
}
|
||||
completeStep_para = {
|
||||
"t":t,
|
||||
"removeIds":removeIds,
|
||||
"showReward":showReward
|
||||
};
|
||||
NetTask.getIns().finishStep(t.id,t.typeId,removeIds,null,completeStepHandler);
|
||||
}
|
||||
|
||||
private function completeStepHandler(rewardData:Object, re:Object) : void
|
||||
{
|
||||
var rewardResult:RewardResultVo = null;
|
||||
var leftNum:int = 0;
|
||||
var i:int = 0;
|
||||
var itemVo:ItemVo = null;
|
||||
var mons:Array = null;
|
||||
var costTi:int = int(re.costTi);
|
||||
if(rewardData != null)
|
||||
{
|
||||
rewardResult = RewardCenter.getRewardResultVoByData(rewardData);
|
||||
}
|
||||
var removeIds:Array = completeStep_para.removeIds;
|
||||
var t:TaskVo = completeStep_para.t;
|
||||
t.stepValue = re.taskStepValue;
|
||||
var statusType:String = t.stepVo.statusType;
|
||||
if(t.stepVo.statusType == TaskStatusType.GET_MONSTER && int(t.stepVo.statusValue.mode) == 0)
|
||||
{
|
||||
statusType = TaskStatusType.GET_ITEM;
|
||||
}
|
||||
switch(statusType)
|
||||
{
|
||||
case TaskStatusType.GET_ITEM:
|
||||
if(t.stepVo.statusValue.remove == true)
|
||||
{
|
||||
leftNum = int(t.stepVo.statusValue.num);
|
||||
for(i = 0; i < removeIds.length; )
|
||||
{
|
||||
itemVo = BagCenter.getIns().getById(removeIds[i]);
|
||||
if(itemVo.num >= leftNum)
|
||||
{
|
||||
BagCenter.getIns().subNum(itemVo.id,leftNum,true,"交出了 {0} 个 {1}");
|
||||
break;
|
||||
}
|
||||
leftNum -= itemVo.num;
|
||||
BagCenter.getIns().subNum(itemVo.id,itemVo.num,true,"交出了 {0} 个 {1}");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TaskStatusType.GET_MONSTER:
|
||||
if(t.stepVo.statusValue.remove == true)
|
||||
{
|
||||
mons = MonsterCenter.getIns().idsToMons(removeIds);
|
||||
MonsterCenter.getIns().removeLocalMonsters(mons);
|
||||
}
|
||||
break;
|
||||
case TaskStatusType.GET_MONEY:
|
||||
if(t.stepVo.statusValue.remove == true)
|
||||
{
|
||||
MasterCenter.getIns().addMoney(-t.stepVo.statusValue.money,true);
|
||||
}
|
||||
}
|
||||
if(!t.stepVo.hasBattle() && (t.stepVo.story == "" || t.stepVo.statusType != TaskStatusType.NONE && t.stepVo.afterStory == ""))
|
||||
{
|
||||
completeLocalStep(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
}
|
||||
if(rewardResult != null)
|
||||
{
|
||||
RewardCenter.getIns().getReward(rewardResult,completeStep_para.showReward,"alert",null,completeStep_para.showReward);
|
||||
}
|
||||
MasterCenter.getIns().addTi(-costTi);
|
||||
completeStep_para = null;
|
||||
if(onCompleteStepComplete != null)
|
||||
{
|
||||
onCompleteStepComplete(rewardResult);
|
||||
onCompleteStepComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function unlockLocalTask(taskid:String) : TaskVo
|
||||
{
|
||||
if(Table.task_info[taskid] == null || Table.task_info[taskid].closed == true)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var task:TaskVo = getLocalTaskByTypeId(taskid);
|
||||
if(task == null)
|
||||
{
|
||||
task = new TaskVo();
|
||||
task.id = 0;
|
||||
task.typeId = taskid;
|
||||
Master.tasks.push(task);
|
||||
}
|
||||
task.stepVo = task.startStep;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
return task;
|
||||
}
|
||||
|
||||
public function activityLockStatus(key:String) : Boolean
|
||||
{
|
||||
var result:Boolean = false;
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved && !t.canFinish() && t.stepVo.statusType == TaskStatusType.SYS_LOCK && t.stepVo.statusValue.key == key)
|
||||
{
|
||||
Alert.showMsg(lang("任务 {0} 目标达成!",CP.task(t.name)));
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
if(result)
|
||||
{
|
||||
GuideCenter.getIns().fin(key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function activityMonsterNum(monType:int) : void
|
||||
{
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved && !t.canFinish() && t.stepVo.statusType == TaskStatusType.GET_MONSTER && t.stepVo.statusValue.type == monType)
|
||||
{
|
||||
if(t.stepVo.isStatusComplete())
|
||||
{
|
||||
Alert.showMsg(lang("任务 {0} 目标达成!",CP.task(t.name)));
|
||||
}
|
||||
if(t.stepVo.canStepComplete())
|
||||
{
|
||||
TaskCenter.getIns().finishStep(t,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function activityItemNum(itemType:int) : void
|
||||
{
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved && !t.canFinish() && t.stepVo.statusType == TaskStatusType.GET_ITEM && t.stepVo.statusValue == itemType)
|
||||
{
|
||||
if(t.stepVo.isStatusComplete())
|
||||
{
|
||||
Alert.showMsg(lang("任务 {0} 目标达成!",CP.task(t.name)));
|
||||
}
|
||||
if(t.stepVo.canStepComplete())
|
||||
{
|
||||
TaskCenter.getIns().finishStep(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function activityMoneyNum() : void
|
||||
{
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved && !t.canFinish() && t.stepVo.statusType == TaskStatusType.GET_MONEY)
|
||||
{
|
||||
if(t.stepVo.isStatusComplete())
|
||||
{
|
||||
Alert.showMsg(lang("任务 {0} 目标达成!",CP.task(t.name)));
|
||||
}
|
||||
if(t.stepVo.canStepComplete())
|
||||
{
|
||||
TaskCenter.getIns().finishStep(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addLocalTask(task:TaskVo) : void
|
||||
{
|
||||
Master.tasks.push(task);
|
||||
Alert.showMsg(lang("获得任务 ") + CP.task(task.name));
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
}
|
||||
|
||||
public function receiveTask(taskid:String, show:Boolean = true, onComplete:Function = null) : void
|
||||
{
|
||||
onReceiveTaskComplete = onComplete;
|
||||
var task:TaskVo = getLocalTaskByTypeId(taskid);
|
||||
if(task != null)
|
||||
{
|
||||
receiveTask_task = task;
|
||||
receiveTask_show = show;
|
||||
NetTask.getIns().getTask(task.typeId,receiveTaskHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function receiveTaskHandler(taskData:Object) : void
|
||||
{
|
||||
receiveTask_task.id = taskData.id;
|
||||
receiveTask_task.stepValue = taskData.stepValue;
|
||||
receiveTask_task.step = 0;
|
||||
receiveTask_task.stepVo = receiveTask_task.getStepVo();
|
||||
receiveTask_task.recieved = true;
|
||||
if(receiveTask_show)
|
||||
{
|
||||
Alert.showMsg(lang("获得任务 ") + CP.task(receiveTask_task.name));
|
||||
}
|
||||
receiveTask_task = null;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.TASK_CHANGE));
|
||||
if(onReceiveTaskComplete != null)
|
||||
{
|
||||
onReceiveTaskComplete();
|
||||
onReceiveTaskComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getLocalTaskByTypeId(taskTypeId:String) : TaskVo
|
||||
{
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.typeId == taskTypeId)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTaskListData(type:int = -1) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var t:TaskVo = null;
|
||||
var arrSub:Array = [];
|
||||
var arrMain:Array = [];
|
||||
var arrFinish:Array = [];
|
||||
for(i = 0; i < Master.tasks.length; )
|
||||
{
|
||||
t = Master.tasks[i] as TaskVo;
|
||||
if(!(type != -1 && t.type != type))
|
||||
{
|
||||
if(t.recieved)
|
||||
{
|
||||
if(t.canFinish())
|
||||
{
|
||||
arrFinish.push(t);
|
||||
}
|
||||
else if(t.isMain)
|
||||
{
|
||||
arrMain.push(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrSub.push(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return arrFinish.concat(arrMain.concat(arrSub.reverse()));
|
||||
}
|
||||
|
||||
public function hasTaskByPosition(pos:String) : Boolean
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:* = Master.tasks;
|
||||
while(true)
|
||||
{
|
||||
for each(var t:TaskVo in _loc3_)
|
||||
{
|
||||
if(!t.complete && !t.canFinish() && !t.closed && t.stepVo.position.indexOf(pos) == 0 && t.stepVo.canShow())
|
||||
{
|
||||
if(!(t.stepVo.position != pos && Table.game_setting.closePosCheckType2 != true))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(t.stepVo.position.charAt(pos.length) == "_")
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hasTaskByOtherCity(curcity:int) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
if(!CityVo.checkUnlock(curcity))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var citys:Array = [1,2,3,4,5];
|
||||
citys.splice(citys.indexOf(curcity),1);
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.recieved && !t.complete && !t.canFinish())
|
||||
{
|
||||
i = 0;
|
||||
while(i < citys.length)
|
||||
{
|
||||
if(t.stepVo.position.indexOf("city" + citys[i]) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getTaskById(id:int) : TaskVo
|
||||
{
|
||||
var t:Object = ArrayUtil.getElementByValue(Master.tasks,"id",id);
|
||||
if(t != null)
|
||||
{
|
||||
return t as TaskVo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTaskByType(typeId:String) : TaskVo
|
||||
{
|
||||
var a:Object = null;
|
||||
if(typeId == "1001002")
|
||||
{
|
||||
trace(1);
|
||||
a = Master.tasks;
|
||||
}
|
||||
var t:Object = ArrayUtil.getElementByValue(Master.tasks,"typeId",typeId);
|
||||
if(t != null)
|
||||
{
|
||||
return t as TaskVo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTaskByPosition(pos:String) : TaskVo
|
||||
{
|
||||
var i:int = 0;
|
||||
var t:TaskVo = null;
|
||||
for(i = 0; i < Master.tasks.length; )
|
||||
{
|
||||
t = Master.tasks[i] as TaskVo;
|
||||
if(!t.complete && !t.canFinish() && t.stepVo.position == pos)
|
||||
{
|
||||
return Master.tasks[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getProcessTask(taskid:String) : TaskVo
|
||||
{
|
||||
var i:int = 0;
|
||||
var t:TaskVo = null;
|
||||
for(i = 0; i < Master.tasks.length; )
|
||||
{
|
||||
t = Master.tasks[i] as TaskVo;
|
||||
if(t.typeId == taskid)
|
||||
{
|
||||
return Master.tasks[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function hasTaskFinish() : Boolean
|
||||
{
|
||||
for each(var t:TaskVo in Master.tasks)
|
||||
{
|
||||
if(t.canFinish() && !t.complete)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkReceivableTask() : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var rvo:TaskVo = null;
|
||||
var curTaskTypeIds:Array = [];
|
||||
var addNew:Boolean = false;
|
||||
for(i = 0; i < Master.tasks.length; )
|
||||
{
|
||||
curTaskTypeIds.push(Master.tasks[i].typeId);
|
||||
i++;
|
||||
}
|
||||
for(var key:String in Master.history.unlockTask)
|
||||
{
|
||||
if(Table.task_info[key] != null && Table.task_info[key].closed != true && Master.history.passTask[key] == null && curTaskTypeIds.indexOf(key) == -1)
|
||||
{
|
||||
rvo = new TaskVo();
|
||||
rvo.id = 0;
|
||||
rvo.typeId = key;
|
||||
rvo.stepVo = rvo.startStep;
|
||||
rvo.stepVo.isStartStep = true;
|
||||
Master.tasks.push(rvo);
|
||||
addNew = true;
|
||||
}
|
||||
}
|
||||
return addNew;
|
||||
}
|
||||
|
||||
public function autoCheckResetLoopTask() : void
|
||||
{
|
||||
if(resetingLoopTask)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var oldDay:String = MyrCalendar.getDayNumber(Master.history.loopTaskTime * 1000).toString();
|
||||
var newDay:String = MyrCalendar.getDayNumber(TimeCenter.timestamp * 1000 - 10000).toString();
|
||||
if(oldDay != newDay)
|
||||
{
|
||||
resetLoopTask();
|
||||
}
|
||||
}
|
||||
|
||||
public function resetLoopTask() : void
|
||||
{
|
||||
resetingLoopTask = true;
|
||||
NetTask.getIns().resetLoopTask(resetLoopTaskHandler);
|
||||
}
|
||||
|
||||
private function resetLoopTaskHandler(newLoopTask:Object) : void
|
||||
{
|
||||
var t:TaskVo = null;
|
||||
var i:int = 0;
|
||||
Master.history.loopTaskNum = GameMath.loopTaskMaxNum;
|
||||
Master.history.loopTask = newLoopTask;
|
||||
Master.history.loopTaskTime = TimeCenter.timestamp;
|
||||
for(i = 0; i < Master.tasks.length; )
|
||||
{
|
||||
t = Master.tasks[i];
|
||||
if(t.type == TaskType.LOOP_TASK)
|
||||
{
|
||||
Alert.showMsg(lang("委托 {0} 超过了时限。",CP.task(t.name)));
|
||||
Master.tasks.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(GuideCenter.getIns().checkFin(GSub.OPEN_XIEHUI))
|
||||
{
|
||||
Alert.showMsg(lang("驯养师协会有新到的委托任务!"));
|
||||
}
|
||||
if(onResetLoopTaskComplete != null)
|
||||
{
|
||||
onResetLoopTaskComplete();
|
||||
onResetLoopTaskComplete = null;
|
||||
}
|
||||
resetingLoopTask = false;
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.LOOP_TASK_UPDATE));
|
||||
}
|
||||
|
||||
public function getLoopTask(taskTypeId:String, city:int, onComplete:Function) : void
|
||||
{
|
||||
onGetLoopTaskComplete = onComplete;
|
||||
getLoopTask_para = {"city":city};
|
||||
NetTask.getIns().getLoopTask(taskTypeId,city,getLoopTaskHandler);
|
||||
}
|
||||
|
||||
private function getLoopTaskHandler(taskData:Object) : void
|
||||
{
|
||||
var newTask:TaskVo = getTaskByTaskData(taskData);
|
||||
Master.tasks.push(newTask);
|
||||
Master.history.loopTaskNum--;
|
||||
ArrayUtil.remove(Master.history.loopTask[getLoopTask_para.city],int(newTask.typeId));
|
||||
Alert.showMsg(lang("接取了委托任务 {0}",CP.task(newTask.name)));
|
||||
getLoopTask_para = null;
|
||||
if(onGetLoopTaskComplete != null)
|
||||
{
|
||||
onGetLoopTaskComplete(newTask);
|
||||
onGetLoopTaskComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function loopTaskResetLeftTime() : int
|
||||
{
|
||||
return MyrCalendar.leftTomorrowSecond(TimeCenter.timestamp * 1000) / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.element.battle.BattleMonVo;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.team.TeamPositionVo;
|
||||
import net.pixvi.myr.element.team.TeamVo;
|
||||
import net.pixvi.myr.event.MYREvent;
|
||||
import net.pixvi.myr.net.NetTeam;
|
||||
import net.pixvi.pfw.utils.broadcast.GlobalBroadcast;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class TeamCenter extends Singleton
|
||||
{
|
||||
|
||||
private var onMonOnComplete:Function;
|
||||
|
||||
private var monOn_para:Object;
|
||||
|
||||
private var onMonOffComplete:Function;
|
||||
|
||||
private var monOff_para:Object;
|
||||
|
||||
public var teamPos2battleTeamPos:Object = {
|
||||
"0":"1",
|
||||
"1":"4",
|
||||
"2":"2",
|
||||
"3":"5",
|
||||
"4":"6",
|
||||
"5":"7",
|
||||
"6":"8",
|
||||
"7":"9"
|
||||
};
|
||||
|
||||
public var checkTeamVailType:int = 0;
|
||||
|
||||
public function TeamCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : TeamCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(TeamCenter) as TeamCenter;
|
||||
}
|
||||
|
||||
public static function getTeamVoByData(data:Object) : TeamVo
|
||||
{
|
||||
var i:int = 0;
|
||||
var team:TeamVo = new TeamVo();
|
||||
team.teamType = data.teamType;
|
||||
team.teamName = data.teamName;
|
||||
team.monsters = [];
|
||||
for(i = 0; i < data.monsters.length; )
|
||||
{
|
||||
if(Table.team_info[data.teamType][i] != null)
|
||||
{
|
||||
team.monsters.push(data.monsters[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return team;
|
||||
}
|
||||
|
||||
public function startUp() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function getTeamPositionArr(teamName:String) : Array
|
||||
{
|
||||
var i:int = 0;
|
||||
var vo:TeamPositionVo = null;
|
||||
var arr:Array = [];
|
||||
var team:TeamVo = getTeamByTeamName(teamName);
|
||||
for(i = 0; i < team.monsters.length; )
|
||||
{
|
||||
vo = new TeamPositionVo();
|
||||
vo.team = team;
|
||||
vo.position = i;
|
||||
arr.push(vo);
|
||||
i++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getTeamByTeamName(name:String) : TeamVo
|
||||
{
|
||||
var getteam:TeamVo = null;
|
||||
for each(var teamvo:TeamVo in Master.teams)
|
||||
{
|
||||
if(teamvo.teamName == name)
|
||||
{
|
||||
getteam = teamvo;
|
||||
}
|
||||
}
|
||||
if(getteam == null)
|
||||
{
|
||||
getteam = new TeamVo();
|
||||
getteam.teamType = "pveBattleTeam";
|
||||
getteam.teamName = name;
|
||||
getteam.monsters = [0,0,0,0,0,0,0,0,0];
|
||||
Master.teams.push(getteam);
|
||||
}
|
||||
return getteam;
|
||||
}
|
||||
|
||||
public function getTeamByTeamType(teamType:String = "battleTeam") : TeamVo
|
||||
{
|
||||
for each(var teamvo:TeamVo in Master.teams)
|
||||
{
|
||||
if(teamvo.teamType == teamType)
|
||||
{
|
||||
return teamvo;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function monOn(teamName:String, position:int, mid:Number, onComplete:Function) : void
|
||||
{
|
||||
onMonOnComplete = onComplete;
|
||||
monOn_para = {
|
||||
"teamName":teamName,
|
||||
"position":position,
|
||||
"mid":mid
|
||||
};
|
||||
NetTeam.getIns().monOn(mid,teamName,position,monOnHandler);
|
||||
}
|
||||
|
||||
private function monOnHandler(re:Object = null) : void
|
||||
{
|
||||
var offMon:MonsterVo = null;
|
||||
var team:TeamVo = getTeamByTeamName(monOn_para.teamName);
|
||||
if(team.monsters[monOn_para.position] > 0)
|
||||
{
|
||||
offMon = MonsterCenter.getIns().getMonById(team.monsters[monOn_para.position]);
|
||||
}
|
||||
team.monsters[monOn_para.position] = monOn_para.mid;
|
||||
if(offMon != null)
|
||||
{
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_REMOVE_TEAM,{"mid":offMon.id}));
|
||||
offMon = null;
|
||||
}
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_ADD_FIGHTSTACK,{"mid":monOn_para.mid}));
|
||||
if(onMonOnComplete != null)
|
||||
{
|
||||
onMonOnComplete();
|
||||
onMonOnComplete = null;
|
||||
}
|
||||
monOn_para = null;
|
||||
}
|
||||
|
||||
public function checkMonsterInTeam(monId:Number) : Boolean
|
||||
{
|
||||
for each(var t:TeamVo in Master.teams)
|
||||
{
|
||||
if(t.monsters.indexOf(monId) != -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAllTeamMonsterId() : Array
|
||||
{
|
||||
var arr:Array = [];
|
||||
for each(var t:TeamVo in Master.teams)
|
||||
{
|
||||
arr = arr.concat(t.monsters);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function monOff(teamname:String = "", position:int = 1, onComplete:Function = null) : void
|
||||
{
|
||||
onMonOffComplete = onComplete;
|
||||
monOff_para = {
|
||||
"teamname":teamname,
|
||||
"position":position
|
||||
};
|
||||
NetTeam.getIns().monOff(teamname,position,monOffHandler);
|
||||
}
|
||||
|
||||
private function monOffHandler(re:Object = null) : void
|
||||
{
|
||||
var teamVo:TeamVo = getTeamByTeamName(monOff_para.teamname);
|
||||
GlobalBroadcast.dispatchEvent(new MYREvent(MYREvent.MONSTER_REMOVE_TEAM,{"mid":teamVo.monsters[monOff_para.position]}));
|
||||
teamVo.monsters[monOff_para.position] = 0;
|
||||
monOff_para = null;
|
||||
if(onMonOffComplete != null)
|
||||
{
|
||||
onMonOffComplete();
|
||||
onMonOffComplete = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getBattleTeamVo(choseTeamName:String = "") : BattleTeamVo
|
||||
{
|
||||
var i:int = 0;
|
||||
var m:BattleMonVo = null;
|
||||
if(choseTeamName == "")
|
||||
{
|
||||
choseTeamName = (Master.teams[0] as TeamVo).teamName;
|
||||
}
|
||||
var teamVo:TeamVo = getTeamByTeamName(choseTeamName);
|
||||
var battleTeamVo:BattleTeamVo = new BattleTeamVo();
|
||||
battleTeamVo.ap = Master.ap;
|
||||
battleTeamVo.apMax = battleTeamVo.ap;
|
||||
battleTeamVo.numMax = TeamCenter.getIns().fightMonsterNum;
|
||||
battleTeamVo.team = 1;
|
||||
battleTeamVo.name = Master.name;
|
||||
for(i = 0; i < teamVo.monsters.length; )
|
||||
{
|
||||
if(teamVo.monsters[i] > 0)
|
||||
{
|
||||
m = MonsterCenter.getIns().getBattleMonVoByMid(teamVo.monsters[i]);
|
||||
if(m != null)
|
||||
{
|
||||
m.team = 1;
|
||||
m.from = "master";
|
||||
m.apRecovery = true;
|
||||
battleTeamVo.mons.push(m);
|
||||
m.teamPos = teamPos2battleTeamPos[i];
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return battleTeamVo;
|
||||
}
|
||||
|
||||
public function checkTeamLegal(teamName:String, show:Boolean = false) : Object
|
||||
{
|
||||
var illegal:Array = null;
|
||||
var team:TeamVo = null;
|
||||
var mons:Array = null;
|
||||
var max:int = 0;
|
||||
var cur:int = 0;
|
||||
if(Table.team_info.teamMonTypes[teamName] != null)
|
||||
{
|
||||
illegal = [];
|
||||
team = TeamCenter.getIns().getTeamByTeamName(teamName);
|
||||
mons = MonsterCenter.getIns().getMonByIds(team.monsters);
|
||||
for each(var mon:MonsterVo in mons)
|
||||
{
|
||||
if(Table.team_info.teamMonTypes[teamName].indexOf(mon.type) == -1)
|
||||
{
|
||||
illegal.push(mon);
|
||||
}
|
||||
}
|
||||
if(illegal.length > 0)
|
||||
{
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("队伍中有不符合类型规定的魔物。"));
|
||||
}
|
||||
return illegal;
|
||||
}
|
||||
}
|
||||
if(Table.team_info.teamStar[teamName] != null)
|
||||
{
|
||||
max = int(Table.team_info.teamStar[teamName]);
|
||||
cur = TeamCenter.getIns().getTeamAllStar(teamName);
|
||||
if(max != 0 && cur > max)
|
||||
{
|
||||
Alert.showMsg(lang("队伍中的魔物星级总数已超出规定。"));
|
||||
return cur - max;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTeamAllStar(teamName:String) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var m:MonsterVo = null;
|
||||
var count:int = 0;
|
||||
var teamVo:TeamVo = getTeamByTeamName(teamName);
|
||||
for(i = 0; i < teamVo.monsters.length; )
|
||||
{
|
||||
if(teamVo.monsters[i] > 0)
|
||||
{
|
||||
m = MonsterCenter.getIns().getMonById(teamVo.monsters[i]);
|
||||
count += m.star;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public function checkTeamVail(teamName:String = "", show:Boolean = false) : Boolean
|
||||
{
|
||||
var teamvo:TeamVo = null;
|
||||
var mon:MonsterVo = null;
|
||||
teamvo = getTeamByTeamName(teamName);
|
||||
var num:int = 0;
|
||||
for each(var s:int in teamvo.monsters)
|
||||
{
|
||||
if(s > 0)
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(s);
|
||||
if(mon.inExploreTeam)
|
||||
{
|
||||
checkTeamVailType = 1;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("战阵中的魔物正在外出探索。"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if(num > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
checkTeamVailType = 0;
|
||||
if(show)
|
||||
{
|
||||
Alert.showMsg(lang("战阵中没有可用的魔物。"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function checkTeamHasEmpty(teamName:String = "") : Boolean
|
||||
{
|
||||
var teamvo:TeamVo = null;
|
||||
if(teamName == "")
|
||||
{
|
||||
teamName = Master.curBattleTeam;
|
||||
}
|
||||
teamvo = getTeamByTeamName(teamName);
|
||||
if(teamvo.hasEmpty() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getFightStackMonsters(teamName:String = "") : Array
|
||||
{
|
||||
var mons:Array = [];
|
||||
var teamVo:TeamVo = getTeamByTeamName(teamName);
|
||||
for each(var mid:Number in teamVo.monsters)
|
||||
{
|
||||
if(mid > 0)
|
||||
{
|
||||
mons.push(MonsterCenter.getIns().getMonById(mid));
|
||||
}
|
||||
}
|
||||
return mons;
|
||||
}
|
||||
|
||||
public function get fightMonsterNum() : int
|
||||
{
|
||||
var j:int = 0;
|
||||
var i:int = 0;
|
||||
for(j = 0; Table.team_info.battleTeam[j.toString()] != null; )
|
||||
{
|
||||
if(Master.level >= Table.team_info.battleTeam[j].level)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
if(i > 4)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public function getTeamZdl(teamName:String) : int
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:MonsterVo = null;
|
||||
var zdl:int = 0;
|
||||
var teamVo:TeamVo = getTeamByTeamName(teamName);
|
||||
for(i = 0; i < teamVo.monsters.length; )
|
||||
{
|
||||
if(teamVo.monsters[i] > 0)
|
||||
{
|
||||
mon = MonsterCenter.getIns().getMonById(teamVo.monsters[i]);
|
||||
zdl += GameMath.zl_monVo(mon);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return zdl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.common.driver.ClockDriver;
|
||||
import net.pixvi.myr.net.NetSystem;
|
||||
import net.pixvi.pfw.utils.core.Singleton;
|
||||
|
||||
public class TimeCenter
|
||||
{
|
||||
|
||||
private var onStartTimeSynchroComplete:Function;
|
||||
|
||||
public function TimeCenter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getIns() : TimeCenter
|
||||
{
|
||||
return Singleton.getInstanceOrCreate(TimeCenter);
|
||||
}
|
||||
|
||||
public static function get timestamp() : Number
|
||||
{
|
||||
return ClockDriver.getInstance().timestamp;
|
||||
}
|
||||
|
||||
public function startTimeSynchro(onsynchroComplete:Function = null) : void
|
||||
{
|
||||
onStartTimeSynchroComplete = onsynchroComplete;
|
||||
NetSystem.getIns().synchroTime(startTimeSynchroHandler);
|
||||
}
|
||||
|
||||
private function startTimeSynchroHandler(timeSecond:Number) : void
|
||||
{
|
||||
ClockDriver.getInstance().timestamp = timeSecond;
|
||||
if(onStartTimeSynchroComplete != null)
|
||||
{
|
||||
onStartTimeSynchroComplete();
|
||||
onStartTimeSynchroComplete = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.pixvi.myr.element
|
||||
{
|
||||
import net.pixvi.common.system.language.lang;
|
||||
|
||||
public class MonsterElement
|
||||
{
|
||||
|
||||
public static var elementNameDic:Object = {
|
||||
"1":"水",
|
||||
"2":"火",
|
||||
"3":"地",
|
||||
"4":"风",
|
||||
"5":"无"
|
||||
};
|
||||
|
||||
public static var elementDesDic:Object = {
|
||||
"1":"水属性<br/>克制火属性<br/>被地属性克制",
|
||||
"2":"火属性<br/>克制风属性<br/>被水属性克制",
|
||||
"3":"地属性<br/>克制水属性<br/>被风属性克制",
|
||||
"4":"风属性<br/>克制地属性<br/>被火属性克制",
|
||||
"5":"不克制任何属性<br/>不被任何属性克制"
|
||||
};
|
||||
|
||||
public static var elementBossDes:Object = {
|
||||
"1":"【地属性伤害+15%】",
|
||||
"2":"【水属性伤害+15%】",
|
||||
"3":"【风属性伤害+15%】",
|
||||
"4":"【火属性伤害+15%】"
|
||||
};
|
||||
|
||||
public function MonsterElement()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getElementName(element:int) : String
|
||||
{
|
||||
return lang(elementNameDic[element]);
|
||||
}
|
||||
|
||||
public static function getElementTip(element:int) : String
|
||||
{
|
||||
return lang(elementDesDic[element]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.pixvi.myr.element
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
|
||||
public class SettingVo extends PiObject
|
||||
{
|
||||
|
||||
public var quality:int = 3;
|
||||
|
||||
public var openBgm:Boolean = true;
|
||||
|
||||
public var openEffect:Boolean = true;
|
||||
|
||||
public var liuhaiMode:Boolean = false;
|
||||
|
||||
public var openVocal:Boolean = true;
|
||||
|
||||
public var quickSkill:Boolean = true;
|
||||
|
||||
public var globalVolume:Number = 1;
|
||||
|
||||
public function SettingVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package net.pixvi.myr.element.achi
|
||||
{
|
||||
public class AchiType
|
||||
{
|
||||
|
||||
public static var HUNTER:String = "hunter";
|
||||
|
||||
public static var FEED:String = "feed";
|
||||
|
||||
public static var COLLECTION:String = "collection";
|
||||
|
||||
public static var LIB:String = "lib";
|
||||
|
||||
public static var EQUIP:String = "equipLib";
|
||||
|
||||
public static var STAGE:String = "stage";
|
||||
|
||||
public static var STARS:String = "stars";
|
||||
|
||||
public static var MONEY:String = "money";
|
||||
|
||||
public static var PULL_MENU:String = "pullMenu";
|
||||
|
||||
public static var LEVEL:String = "level";
|
||||
|
||||
public static var STAGE_LEVELS:String = "stageLevel";
|
||||
|
||||
public static var ENTANGLE:String = "entangle";
|
||||
|
||||
public static var ITEM:String = "item";
|
||||
|
||||
public static var NONE:String = "none";
|
||||
|
||||
public static var SKIN:String = "skin";
|
||||
|
||||
public static var CHECK_DAY:String = "check";
|
||||
|
||||
public static var CHECK_DAY_TOTAL:String = "checkTotal";
|
||||
|
||||
public static var achiTypeObject:Object = {
|
||||
"hunter":{
|
||||
"type":1001001,
|
||||
"num":100
|
||||
},
|
||||
"feed":{
|
||||
"type":1001001,
|
||||
"num":10
|
||||
},
|
||||
"collection":{"types":[1001001,2002001]},
|
||||
"stage":{
|
||||
"stage":"0101",
|
||||
"level":"1"
|
||||
},
|
||||
"stars":{
|
||||
"num":5,
|
||||
"city":1
|
||||
},
|
||||
"money":{"num":1000},
|
||||
"pullMenu":{"num":50},
|
||||
"battleCount":{"num":50},
|
||||
"lib":{"num":10},
|
||||
"equipLib":{"num":10},
|
||||
"level":{"level":10},
|
||||
"stageLevel":{"stageLevels":{"0101":["2","3"]}},
|
||||
"entangle":{
|
||||
"num":1,
|
||||
"star":"12345",
|
||||
"level":"1"
|
||||
},
|
||||
"item":{
|
||||
"itemType":"10001",
|
||||
"num":"1"
|
||||
},
|
||||
"none":{"passGuide":""},
|
||||
"skin":{"num":10},
|
||||
"check":{"num":10},
|
||||
"checkTotal":{"num":100}
|
||||
};
|
||||
|
||||
public static var achiTypeDes:Object = {
|
||||
"hunter":{"des":"狩猎{type}魔物{num}只"},
|
||||
"feed":{"des":"养成{type}成年魔物{num}只"},
|
||||
"collection":{"des":"图鉴解锁目标全部魔物{types[...]}"},
|
||||
"stage":{"des":"通过关卡{stage}的{level}难度探索"},
|
||||
"stars":{"des":"累积获得{city}区域的关卡星星{num}个"},
|
||||
"money":{"des":"累积赚取{num}金币"},
|
||||
"pullMenu":{"des":"玩弄背包挂件{num}次"},
|
||||
"battleCount":{"des":"累积进行了战斗{num}次"},
|
||||
"lib":{"des":"总解锁的魔物图鉴数量{num}"},
|
||||
"equipLib":{"des":"总解锁的装备图鉴数量{num}"},
|
||||
"level":{"des":"当角色达到{level}级时可完成成就"},
|
||||
"stageLevel":{"des":"当通过制定关卡的指定难度时,完成成就"},
|
||||
"entangle":{"des":"{star}星级范围的魔物累计达到或超过{level}羁绊{num}只,成就完成"},
|
||||
"item":{"des":"拥有类型{itemType}道具{num}个时,完成成就"},
|
||||
"none":{"des":"完成指引{guidePass}时可完成成就"},
|
||||
"skin":{"des":"收集到{num}个皮肤时完成"},
|
||||
"check":{"des":"连续获得补给{num}天时完成"},
|
||||
"checkTotal":{"des":"累计获得补给{num}天时完成"}
|
||||
};
|
||||
|
||||
public function AchiType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
package net.pixvi.myr.element.achi
|
||||
{
|
||||
import net.pixvi.common.utils.PiObject;
|
||||
import net.pixvi.myr.center.BagCenter;
|
||||
import net.pixvi.myr.center.GuideCenter;
|
||||
import net.pixvi.myr.center.LibCenter;
|
||||
import net.pixvi.myr.center.Master;
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
|
||||
public class AchiVo extends PiObject
|
||||
{
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var isComplete:Boolean = false;
|
||||
|
||||
public var showComplete:Boolean = false;
|
||||
|
||||
public function AchiVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(id:int) : void
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public function get next() : Array
|
||||
{
|
||||
return table().next;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return table().name;
|
||||
}
|
||||
|
||||
public function get des() : String
|
||||
{
|
||||
return table().des;
|
||||
}
|
||||
|
||||
public function get reward() : Object
|
||||
{
|
||||
return table().reward;
|
||||
}
|
||||
|
||||
public function get closed() : Boolean
|
||||
{
|
||||
if(table().closed == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return table().closed;
|
||||
}
|
||||
|
||||
public function get rewardvo() : RewardVo
|
||||
{
|
||||
var r:RewardVo = new RewardVo();
|
||||
r.setByObject(reward);
|
||||
return r;
|
||||
}
|
||||
|
||||
public function get desOfProcess() : String
|
||||
{
|
||||
var stars:String = null;
|
||||
var num:int = 0;
|
||||
var cur:* = 0;
|
||||
var target:int = 0;
|
||||
switch(type)
|
||||
{
|
||||
case AchiType.COLLECTION:
|
||||
cur = LibCenter.getIns().getNumUnlockByMonTypes(ArrayUtil.split(achiPara.types,",",true));
|
||||
target = int(achiPara.types.length);
|
||||
break;
|
||||
case AchiType.FEED:
|
||||
if(Master.history.numFeedMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numFeedMonsters[achiPara.type] = 0;
|
||||
}
|
||||
cur = int(Master.history.numFeedMonsters[achiPara.type]);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.SKIN:
|
||||
if(Master.history.unlockSkins == null)
|
||||
{
|
||||
cur = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur = int(Master.history.unlockSkins.length);
|
||||
}
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.HUNTER:
|
||||
if(Master.history.numKillMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[achiPara.type] = 0;
|
||||
}
|
||||
cur = int(Master.history.numKillMonsters[achiPara.type]);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.MONEY:
|
||||
cur = int(Master.history.numAddMoney);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.STAGE:
|
||||
cur = 0;
|
||||
target = 1;
|
||||
break;
|
||||
case AchiType.STARS:
|
||||
cur = StageCenter.getIns().countStars();
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.PULL_MENU:
|
||||
cur = int(Master.history.pullMenu);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.ENTANGLE:
|
||||
stars = achiPara.star;
|
||||
num = 0;
|
||||
for each(var m:MonsterVo in Master.monsters)
|
||||
{
|
||||
if(m.entangle && stars.indexOf(m.star.toString()) >= 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
cur = num;
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.LEVEL:
|
||||
cur = int(Master.level);
|
||||
target = int(achiPara.level);
|
||||
break;
|
||||
case AchiType.ITEM:
|
||||
cur = BagCenter.getIns().getNum(achiPara.itemType);
|
||||
target = int(achiPara.num);
|
||||
break;
|
||||
case AchiType.STAGE_LEVELS:
|
||||
target = 0;
|
||||
cur = 0;
|
||||
for(var key:String in achiPara.stageLevels)
|
||||
{
|
||||
for each(var slv:String in achiPara.stageLevels[key])
|
||||
{
|
||||
if(StageCenter.getIns().isStagePass(key,int(slv)))
|
||||
{
|
||||
cur++;
|
||||
}
|
||||
target++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cur + "/" + target;
|
||||
}
|
||||
|
||||
public function get achiPara() : Object
|
||||
{
|
||||
return table().achiPara;
|
||||
}
|
||||
|
||||
public function get achiType() : String
|
||||
{
|
||||
return table().achiType;
|
||||
}
|
||||
|
||||
public function get achiTag() : String
|
||||
{
|
||||
return table().tag;
|
||||
}
|
||||
|
||||
public function get type() : String
|
||||
{
|
||||
return table().achiType;
|
||||
}
|
||||
|
||||
public function get hide() : Boolean
|
||||
{
|
||||
return table().hide;
|
||||
}
|
||||
|
||||
public function table() : Object
|
||||
{
|
||||
return Table.achi_info[id];
|
||||
}
|
||||
|
||||
public function canFinish() : Boolean
|
||||
{
|
||||
var cur:int = 0;
|
||||
var target:int = 0;
|
||||
var stars:String = null;
|
||||
var num:int = 0;
|
||||
var itemnum:int = 0;
|
||||
var daynum:int = 0;
|
||||
daynum = 0;
|
||||
switch(type)
|
||||
{
|
||||
case AchiType.COLLECTION:
|
||||
return LibCenter.getIns().checkUnlocks(ArrayUtil.split(achiPara.types));
|
||||
case AchiType.FEED:
|
||||
if(Master.history.numFeedMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numFeedMonsters[achiPara.type] = 0;
|
||||
}
|
||||
return Master.history.numFeedMonsters[achiPara.type] >= achiPara.num;
|
||||
case AchiType.HUNTER:
|
||||
if(Master.history.numKillMonsters[achiPara.type] == null)
|
||||
{
|
||||
Master.history.numKillMonsters[achiPara.type] = 0;
|
||||
}
|
||||
return Master.history.numKillMonsters[achiPara.type] >= achiPara.num;
|
||||
case AchiType.MONEY:
|
||||
return Master.history.numAddMoney >= achiPara.num;
|
||||
case AchiType.STAGE:
|
||||
if(Master.history.passStage[achiPara.stage] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(Master.history.passStage[achiPara.stage][1] == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.STARS:
|
||||
return StageCenter.getIns().countStars() >= achiPara.num;
|
||||
case AchiType.PULL_MENU:
|
||||
return Master.history.pullMenu >= achiPara.num;
|
||||
case AchiType.LEVEL:
|
||||
return Master.level >= achiPara.level;
|
||||
case AchiType.STAGE_LEVELS:
|
||||
loop0:
|
||||
for(var key:String in achiPara.stageLevels)
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc10_:* = achiPara.stageLevels[key];
|
||||
do
|
||||
{
|
||||
for each(var slv:String in _loc10_)
|
||||
{
|
||||
}
|
||||
continue loop0;
|
||||
}
|
||||
while(StageCenter.getIns().isStagePass(key,int(slv)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case AchiType.SKIN:
|
||||
cur = 0;
|
||||
if(Master.history.unlockSkins == null)
|
||||
{
|
||||
cur = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur = int(Master.history.unlockSkins.length);
|
||||
}
|
||||
target = int(achiPara.num);
|
||||
if(target <= cur)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.ENTANGLE:
|
||||
stars = achiPara.star;
|
||||
num = 0;
|
||||
for each(var m:MonsterVo in Master.monsters)
|
||||
{
|
||||
if(m.entangle && m.entangleLevel >= int(achiPara.level) && stars.indexOf(m.star.toString()) >= 0)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if(num >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.ITEM:
|
||||
itemnum = BagCenter.getIns().getNum(achiPara.itemType);
|
||||
if(itemnum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.CHECK_DAY:
|
||||
daynum = int(Master.activityHistory.dailyGiftCount);
|
||||
if(daynum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.CHECK_DAY:
|
||||
daynum = int(Master.activityHistory.dailyGiftSignCount);
|
||||
if(daynum >= achiPara.num)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case AchiType.NONE:
|
||||
if(achiPara.passGuide != null)
|
||||
{
|
||||
return GuideCenter.getIns().checkFin(achiPara.passGuide);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user