觉醒时刻
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

353 lines
26 KiB

import { ryw_Event } from "../../../FrameWork/Event/EventEnum";
import EventMgr from "../../../FrameWork/Event/EventMgr";
import User from "../../../FrameWork/User/User";
import Common5 from "../../../Platform/th/Common5";
import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager";
import BagManager from "../../Manager/BagManager";
import InterfaceManager from "../../Manager/InterfaceManager";
const { ccclass, property } = cc._decorator;
export enum HookClawState {
START = 'start',
LAUNCH = 'launch',
RECOVERY = 'recovery'
}
const HuangJinYuFuConfig = {
//普通鱼 80%
commonFishType: [
{ goodId: 3501, goodName: '龙虾', url: 'prefab/龙虾', skin: '口味虾', descStr: '龙虾', moveType: 1, moveSpeed: 150, catchPbl: 1, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 10000 },
{ goodId: 3502, goodName: '小丑鱼', url: 'prefab/小丑鱼', skin: '尼莫', descStr: '小丑鱼', moveType: 1, moveSpeed: 150, catchPbl: 1, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 1000 },
{ goodId: 3503, goodName: '螃蟹', url: 'prefab/螃蟹', skin: '庞海', descStr: '螃蟹', moveType: 1, moveSpeed: 150, catchPbl: 1, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 800 },
{ goodId: 3504, goodName: '蚌壳', url: 'prefab/蚌壳', skin: '贝壳', descStr: '蚌壳', moveType: 0, moveSpeed: 0, catchPbl: 0.95, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 500 },
{ goodId: 3505, goodName: '海星', url: 'prefab/海星', skin: '还行', descStr: '海星', moveType: 0, moveSpeed: 0, catchPbl: 0.95, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 20 },
{ goodId: 3506, goodName: '鳖', url: 'prefab/鳖', skin: '王八', descStr: '鳖', moveType: 1, moveSpeed: 150, catchPbl: 0.9, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 2000 },
{ goodId: 3507, goodName: '海胆', url: 'prefab/海胆', skin: '海胆', descStr: '海胆', moveType: 0, moveSpeed: 0, catchPbl: 0.95, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 1000 },
{ goodId: 3508, goodName: '海鱼1', url: 'prefab/海鱼1', skin: '海鱼1', descStr: '海鱼1', moveType: 1, moveSpeed: 200, catchPbl: 0.95, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 3000 },
{ goodId: 3509, goodName: '海鱼2', url: 'prefab/海鱼2', skin: '海鱼2', descStr: '海鱼2', moveType: 1, moveSpeed: 200, catchPbl: 0.75, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 2000 },
{ goodId: 3510, goodName: '海鱼3', url: 'prefab/海鱼3', skin: '海鱼3', descStr: '海鱼3', moveType: 1, moveSpeed: 200, catchPbl: 0.7, recoverySpeed: 0.7, appearPbl: 0.1, priceNum: 2000 },
],
//特殊鱼 20%
specialFishType: [
{ goodId: 3511, goodName: '烟斗龟', url: 'prefab/烟斗龟', skin: '烟斗龟', descStr: '烟斗龟', moveType: 1, moveSpeed: 150, catchPbl: 0.75, appearPbl: 0.5, recoverySpeed: 0.5, priceNum: 50000 },
{ goodId: 3512, goodName: '章鱼', url: 'prefab/章鱼', skin: '章鱼', descStr: '章鱼', moveType: 2, moveSpeed: 150, catchPbl: 0.75, appearPbl: 0.5, recoverySpeed: 0.5, priceNum: 50000 },
{ goodId: 3513, goodName: '刺豚', url: 'prefab/刺豚', skin: '刺豚', descStr: '刺豚', moveType: 1, moveSpeed: 200, catchPbl: 0.75, appearPbl: 0.5, recoverySpeed: 0.5, priceNum: 50000 },
{ goodId: 3514, goodName: '大黄鱼', url: 'prefab/大黄鱼', skin: '大黄鱼', descStr: '大黄鱼', moveType: 1, moveSpeed: 300, catchPbl: 0.75, appearPbl: 0.1, recoverySpeed: 0.5, priceNum: 50000 },
{ goodId: 3515, goodName: '深海龟王', url: 'prefab/深海龟王', skin: '深海龟王', descStr: '深海龟王', moveType: 1, moveSpeed: 300, catchPbl: 0.3, appearPbl: 0.15, recoverySpeed: 0.5, priceNum: 99999 },
{ goodId: 3516, goodName: '黄金海马', url: 'prefab/黄金海马', skin: '黄金海马', descStr: '黄金海马', moveType: 1, moveSpeed: 300, catchPbl: 0.3, appearPbl: 0.15, recoverySpeed: 0.5, priceNum: 99999 },
],
//剧情道具
specialPropType: [
{ goodId: 3035, goodName: '龟印碎片1', url: 'prefab/龟印碎片1', skin: '龟印碎片1', descStr: '龟印碎片1', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3036, goodName: '龟印碎片2', url: 'prefab/龟印碎片2', skin: '龟印碎片2', descStr: '龟印碎片2', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3037, goodName: '龟印碎片3', url: 'prefab/龟印碎片3', skin: '龟印碎片3', descStr: '龟印碎片3', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3038, goodName: '龟印碎片4', url: 'prefab/龟印碎片4', skin: '龟印碎片4', descStr: '龟印碎片4', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3039, goodName: '龟印碎片5', url: 'prefab/龟印碎片5', skin: '龟印碎片5', descStr: '龟印碎片5', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3042, goodName: '青铜酒杯', url: 'prefab/青铜酒杯', skin: '青铜酒杯', descStr: '青铜酒杯', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3043, goodName: '青铜鼎', url: 'prefab/青铜鼎', skin: '青铜鼎', descStr: '青铜鼎', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3044, goodName: '青铜剑', url: 'prefab/青铜剑', skin: '青铜剑', descStr: '青铜剑', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3045, goodName: '青铜鹤壶', url: 'prefab/青铜鹤壶', skin: '青铜鹤壶', descStr: '青铜鹤壶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3046, goodName: '青铜尊', url: 'prefab/青铜尊', skin: '青铜尊', descStr: '青铜尊', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3095, goodName: '财务报表', url: 'prefab/财务报表', skin: '财务报表', descStr: '财务报表', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3096, goodName: '合作协议', url: 'prefab/合作协议', skin: '合作协议', descStr: '合作协议', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3097, goodName: '专利证书', url: 'prefab/专利证书', skin: '专利证书', descStr: '专利证书', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3098, goodName: '员工档案', url: 'prefab/员工档案', skin: '员工档案', descStr: '员工档案', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3099, goodName: '审计报告', url: 'prefab/审计报告', skin: '审计报告', descStr: '审计报告', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3734, goodName: '车祸汽车', url: 'prefab/车祸汽车', skin: '车祸汽车', descStr: '车祸汽车', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3735, goodName: '转账手机', url: 'prefab/转账手机', skin: '转账手机', descStr: '转账手机', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3736, goodName: '监控硬盘', url: 'prefab/监控硬盘', skin: '监控硬盘', descStr: '监控硬盘', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3771, goodName: '灵源果', url: 'prefab/灵源果', skin: '灵源果', descStr: '灵源果', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3772, goodName: '炎晶草', url: 'prefab/炎晶草', skin: '炎晶草', descStr: '炎晶草', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3773, goodName: '雷参', url: 'prefab/雷参', skin: '雷参', descStr: '雷参', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3774, goodName: '幻蝶兰', url: 'prefab/幻蝶兰', skin: '幻蝶兰', descStr: '幻蝶兰', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3775, goodName: '星陨神芝', url: 'prefab/星陨神芝', skin: '星陨神芝', descStr: '星陨神芝', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3776, goodName: '圣莲', url: 'prefab/圣莲', skin: '圣莲', descStr: '圣莲', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3808, goodName: '至尊决', url: 'prefab/至尊决', skin: '至尊决', descStr: '至尊决', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3809, goodName: '至尊兵', url: 'prefab/至尊兵', skin: '至尊兵', descStr: '至尊兵', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3810, goodName: '至尊甲', url: 'prefab/至尊甲', skin: '至尊甲', descStr: '至尊甲', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3811, goodName: '至尊戒', url: 'prefab/至尊戒', skin: '至尊戒', descStr: '至尊戒', moveType: 1, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3520, goodName: '锅', url: 'prefab/锅', skin: '锅', descStr: '锅', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3521, goodName: '菜刀', url: 'prefab/菜刀', skin: '菜刀', descStr: '菜刀', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3522, goodName: '菜板', url: 'prefab/菜板', skin: '菜板', descStr: '菜板', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3602, goodName: '川菜御厨匾', url: 'prefab/川菜御厨匾', skin: '川菜御厨匾', descStr: '川菜御厨匾', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3523, goodName: '金钱猛鱼', url: 'prefab/金钱猛鱼', skin: '窄鱼', descStr: '金钱猛鱼', moveType: 1, moveSpeed: 200, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.3, priceNum: 0 },
{ goodId: 3524, goodName: '石斑鱼', url: 'prefab/石斑鱼', skin: '宽鱼', descStr: '石斑鱼', moveType: 1, moveSpeed: 200, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.2, priceNum: 0 },
{ goodId: 3525, goodName: '乌贼骨(膳食)', url: 'prefab/乌贼骨(膳食)', skin: '乌贼骨(膳食)', descStr: '乌贼骨(膳食)', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3526, goodName: '鲜海参(膳食)', url: 'prefab/鲜海参(膳食)', skin: '海参', descStr: '鲜海参(膳食)', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3527, goodName: '灯笼鱼(膳食)', url: 'prefab/灯笼鱼(膳食)', skin: '灯笼鱼', descStr: '灯笼鱼(膳食)', moveType: 1, moveSpeed: 200, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.3, priceNum: 0 },
{ goodId: 3528, goodName: '贝壳(膳食)', url: 'prefab/贝壳(膳食)', skin: '贝壳', descStr: '贝壳(膳食)', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3529, goodName: '蓝龙虾(膳食)', url: 'prefab/蓝龙虾(膳食)', skin: '龙虾', descStr: '蓝龙虾(膳食)', moveType: 2, moveSpeed: 200, catchPbl: 0.7, appearPbl: 0, recoverySpeed: 0.3, priceNum: 0 },
{ goodId: 3530, goodName: '带鱼(膳食)', url: 'prefab/带鱼(膳食)', skin: '带鱼', descStr: '带鱼(膳食)', moveType: 1, moveSpeed: 200, catchPbl: 0.7, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3531, goodName: '红王蟹(膳食)', url: 'prefab/红王蟹(膳食)', skin: '螃蟹', descStr: '红王蟹(膳食)', moveType: 1, moveSpeed: 100, catchPbl: 0.7, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3532, goodName: '蓝旗金枪鱼(膳食)', url: 'prefab/蓝旗金枪鱼(膳食)', skin: '蓝鱼', descStr: '蓝旗金枪鱼(膳食)', moveType: 1, moveSpeed: 300, catchPbl: 0.7, appearPbl: 0, recoverySpeed: 0.2, priceNum: 0 },
{ goodId: 3533, goodName: '象拔蚌(膳食)', url: 'prefab/象拔蚌(膳食)', skin: '象拔蚌', descStr: '象拔蚌(膳食)', moveType: 2, moveSpeed: 200, catchPbl: 0.8, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3534, goodName: '门', url: 'prefab/门', skin: '门', descStr: '门', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3535, goodName: '墙纸', url: 'prefab/墙纸', skin: '墙纸', descStr: '墙纸', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3536, goodName: '柜子', url: 'prefab/柜子', skin: '柜子', descStr: '柜子', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3537, goodName: '窗户', url: 'prefab/窗户', skin: '窗户', descStr: '窗户', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3538, goodName: '床', url: 'prefab/床', skin: '床', descStr: '床', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 0 },
{ goodId: 3539, goodName: '抱月瓶', url: 'prefab/抱月瓶', skin: '抱月瓶', descStr: '抱月瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3540, goodName: '贲巴壶', url: 'prefab/贲巴壶', skin: '贲巴壶', descStr: '贲巴壶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3541, goodName: '出戟尊', url: 'prefab/出戟尊', skin: '出戟尊', descStr: '出戟尊', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3542, goodName: '琮式瓶', url: 'prefab/琮式瓶', skin: '琮式瓶', descStr: '琮式瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3543, goodName: '灯笼尊', url: 'prefab/灯笼尊', skin: '灯笼尊', descStr: '灯笼尊', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3544, goodName: '斗笠碗', url: 'prefab/斗笠碗', skin: '斗笠碗', descStr: '斗笠碗', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3545, goodName: '凤尾尊', url: 'prefab/凤尾尊', skin: '凤尾尊', descStr: '凤尾尊', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3546, goodName: '蟠龙瓶', url: 'prefab/蟠龙瓶', skin: '蟠龙瓶', descStr: '蟠龙瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 300000000 },
{ goodId: 3547, goodName: '珐琅蒜头瓶', url: 'prefab/珐琅蒜头瓶', skin: '珐琅蒜头瓶', descStr: '珐琅蒜头瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3548, goodName: '珐琅双连瓶', url: 'prefab/珐琅双连瓶', skin: '珐琅双连瓶', descStr: '珐琅双连瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3549, goodName: '珐琅葫芦瓶', url: 'prefab/珐琅葫芦瓶', skin: '珐琅葫芦瓶', descStr: '珐琅葫芦瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3550, goodName: '珐琅双耳瓶', url: 'prefab/珐琅双耳瓶', skin: '珐琅双耳瓶', descStr: '珐琅双耳瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3551, goodName: '珐琅棒槌瓶', url: 'prefab/珐琅棒槌瓶', skin: '珐琅棒槌瓶', descStr: '珐琅棒槌瓶', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3552, goodName: '珐琅茶壶酒', url: 'prefab/珐琅茶壶酒', skin: '珐琅茶壶酒', descStr: '珐琅茶壶酒', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3553, goodName: '珐琅盅方盒', url: 'prefab/珐琅盅方盒', skin: '珐琅盅方盒', descStr: '珐琅盅方盒', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3554, goodName: '珐琅盖碗', url: 'prefab/珐琅盖碗', skin: '珐琅盖碗', descStr: '珐琅盖碗', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3555, goodName: '珐琅圆盘', url: 'prefab/珐琅圆盘', skin: '珐琅圆盘', descStr: '珐琅圆盘', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1500000000 },
{ goodId: 3098, goodName: '鲁菜食谱', url: 'prefab/鲁菜食谱', skin: '鲁菜食谱', descStr: '鲁菜食谱', moveType: 0, moveSpeed: 0, catchPbl: 1, appearPbl: 0, recoverySpeed: 0.5, priceNum: 1000000 },
]
}
class HuangJinYuFuManager {
public MaxFishNum: number = 5; //最大鱼数量
public SpecialPbl: number = 20; //特殊鱼概率
public fishDataList: any[] = []; //鱼数据列表
//获取鱼信息
public getFishInfoByGoodId(goodId: number) {
for (const key in HuangJinYuFuConfig) {
if (Object.prototype.hasOwnProperty.call(HuangJinYuFuConfig, key)) {
const element = HuangJinYuFuConfig[key];
for (const iterator of element) {
if (iterator.goodId == goodId) {
return iterator;
}
}
}
}
}
//获取鱼信息
public getManagerConfigs() {
let fishInfoList = [];
for (const key in HuangJinYuFuConfig) {
if (Object.prototype.hasOwnProperty.call(HuangJinYuFuConfig, key)) {
const element = HuangJinYuFuConfig[key];
for (let iterator of element) {
let goodsInfo = BagManager.getJuQingGoodConfig(iterator.goodId);
for (const key in goodsInfo) {
if (!iterator[key]) {
iterator[key] = goodsInfo[key];
}
}
fishInfoList.push(iterator);
}
}
}
return fishInfoList;
}
//获取鱼数据
public getFishDataList(fishSizeMap: Map<string, cc.Size>, fishRange: cc.Size) {
return this.randomFishList(fishSizeMap, fishRange); //测试 fix me
this.fishDataList = User.getSaveFishDataList();
if (this.getFishDataListLength() <= 0) {
this.fishDataList = this.randomFishList(fishSizeMap, fishRange);
console.log('生成新的鱼数据!');
//保存鱼数据
let gentQuat = 0; //let gentQuat = User.getGenerateFishQuantity() - 1;
User.setFishDataAndGentQuat(this.fishDataList, gentQuat);
return this.fishDataList;
} else {
console.log('获取旧鱼数据!');
return this.fishDataList;
}
}
//随机生成鱼数据
public randomFishList(fishSizeMap: Map<string, cc.Size>, fishRange: cc.Size) {
let randomFishDataList = [];
//随机生成鱼坐标
const randomNodePos = (fishData) => {
fishData.pos.x = fishData.rect.x = Common5.getRandomNum(-fishRange.width / 2, fishRange.width / 2);
fishData.pos.y = fishData.rect.y = Common5.getRandomNum(-fishRange.height / 2, fishRange.height / 2);
for (const iterator of randomFishDataList) {
if (iterator.rect.intersects(fishData.rect)) {
randomNodePos(fishData);
}
}
}
//随机生成鱼数据
for (let index = 0; index < this.MaxFishNum; index++) {
let fishTypeConfig = HuangJinYuFuConfig.commonFishType;
if (Common5.getRandomNum(0, 100) < this.SpecialPbl) {
fishTypeConfig = HuangJinYuFuConfig.specialFishType;
}
let random = Math.random();
for (const iterator of fishTypeConfig) {
random -= iterator.appearPbl;
if (random < 0) {
let fishSize = fishSizeMap.get(iterator.goodName);
console.log('鱼名:' + iterator.goodName);
let fishData = {
goodId: iterator.goodId,
rect: new cc.Rect(0, 0, fishSize.width, fishSize.height),
pos: cc.v2(0, 0)
};
randomNodePos(fishData);
randomFishDataList.push(fishData);
break;
}
}
}
//生成鱼数据列表
this.fishDataList = [];
for (const iterator of randomFishDataList) {
let fishData = {
goodId: iterator.goodId,
posX: iterator.pos.x,
posY: iterator.pos.y,
};
this.fishDataList.push(fishData);
}
//优先任务Gm
let isHaveTaskGm = false
const taskInfo: any = TaskManager.getCurUnLockMainTaskInfo();
if (taskInfo.Id != MainTaskIdEnum.MainTask_None && taskInfo.Id) {
const configData = TaskManager.getTaskConfigById(taskInfo.Id);
if (configData && configData.GMGameType == "ShenHaiTanBao" && configData.taskCaiGouDan) {
isHaveTaskGm = true;
let list_ = configData.taskCaiGouDan.filter((value, index, self) => {
if (configData.GMGoodIdArray) {
for (const goodId of configData.GMGoodIdArray) {
if (goodId == value) return false;
}
}
if (BagManager.getBagGoodNums(value) > 0) {
return false;
}
return true;
})
if (User.getGenerateFishQuantity() == 1 && configData.GMGoodIdArray) {
for (let goodId of configData.GMGoodIdArray) {
if (BagManager.getBagGoodNums(goodId) == 0) {
list_.push(goodId);
break;
}
}
}
for (let index = 0; index < list_.length; index++) {
this.fishDataList[index].goodId = list_[index];
}
}
}
let daoYeList = InterfaceManager.getDaoyeList();
if (daoYeList.length > 0 && !isHaveTaskGm) {
let list_ = [];
let addFreeGoodsNum = Math.ceil(Math.random() * 2);
let addADGoodsNum = (User.getGenerateFishQuantity() == 1) ? 1 : 0;
for (const item of daoYeList) {
const config = BagManager.getJuQingGoodConfig(item.goodId);
if (config == null || config.GMGameType != 'ShenHaiTanBao') {
list_ = [];
break;
}
if (BagManager.getBagGoodNums(item.goodId) > 0) {
continue;
}
if (config.isCanFreeOut) {
if (addFreeGoodsNum > 0) {
list_.push(item.goodId);
addFreeGoodsNum--;
}
} else {
if (addADGoodsNum > 0) {
list_.push(item.goodId);
addADGoodsNum--;
}
}
}
if (list_.length > 0) {
for (let index = 0; index < list_.length; index++) {
this.fishDataList[index].goodId = list_[index];
isHaveTaskGm = true;
}
}
}
if (isHaveTaskGm) {
this.fishDataList.sort(function () {
return 0.5 - Math.random();
})
}
return this.fishDataList;
}
//删除鱼列表的鱼数据
public deleteFishData(fishData) {
if (this.fishDataList.indexOf(fishData) != -1) {
this.fishDataList.splice(this.fishDataList.indexOf(fishData), 1);
}
User.setFishDataAndGentQuat(this.fishDataList);
}
//获取鱼列表长度
public getFishDataListLength() {
return this.fishDataList.length;
}
//重置刷新次数
public reSetGenFishQua() {
User.setFishDataAndGentQuat([], 1);
}
// 任务完成检测
public checkFinishTask() {
let taskInfo: any = TaskManager.getCurUnLockMainTaskInfo();
if (taskInfo.Id != MainTaskIdEnum.MainTask_None && taskInfo.Id) {
let configData = TaskManager.getTaskConfigById(taskInfo.Id);
if (configData && configData.GMGameType == "ShenHaiTanBao" && configData.taskCaiGouDan) {
let isFinish = true;
for (const id of configData.taskCaiGouDan) {
if (BagManager.getBagGoodNums(id) == 0) {
isFinish = false;
break;
}
}
if (isFinish) {
TaskManager.finishCurMainTask(taskInfo.Id);
if (taskInfo.Id == MainTaskIdEnum.MainTask_803) {
EventMgr.emitEvent_custom(ryw_Event.refreshNeedLayer)
}
}
}
}
}
}
export let hjyfManager = new HuangJinYuFuManager();