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.
50 lines
2.0 KiB
50 lines
2.0 KiB
import User from "../../../FrameWork/User/User";
|
|
import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager";
|
|
|
|
|
|
export default class LiXianShouYiManager {
|
|
public static LiXianConfig = [
|
|
{perSecondMoney:0,minTaskId:MainTaskIdEnum.MainTask_100,maxTaskId:MainTaskIdEnum.MainTask_1305},
|
|
{perSecondMoney:100,minTaskId:MainTaskIdEnum.MainTask_1306,maxTaskId:MainTaskIdEnum.MainTask_1602},
|
|
{perSecondMoney:436,minTaskId:MainTaskIdEnum.MainTask_1603,maxTaskId:MainTaskIdEnum.MainTask_1704},
|
|
{perSecondMoney:3000,minTaskId:MainTaskIdEnum.MainTask_1705,maxTaskId:MainTaskIdEnum.MainTask_1805},
|
|
{perSecondMoney:15500,minTaskId:MainTaskIdEnum.MainTask_1806,maxTaskId:MainTaskIdEnum.MainTask_2101},
|
|
{perSecondMoney:48000,minTaskId:MainTaskIdEnum.MainTask_2102,maxTaskId:MainTaskIdEnum.MainTask_2301},
|
|
{perSecondMoney:300000,minTaskId:MainTaskIdEnum.MainTask_2302,maxTaskId:MainTaskIdEnum.MainTask_2401},
|
|
{perSecondMoney:1300000,minTaskId:MainTaskIdEnum.MainTask_2402,maxTaskId:MainTaskIdEnum.MainTask_2506},
|
|
]
|
|
|
|
public static getLiXianShouYi(){
|
|
//每秒收益
|
|
let perSecondMoney = 0
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
for(let i = 0;i< this.LiXianConfig.length;i++){
|
|
if(mainId >= this.LiXianConfig[i].minTaskId && mainId <= this.LiXianConfig[i].maxTaskId){
|
|
perSecondMoney = this.LiXianConfig[i].perSecondMoney
|
|
break
|
|
}
|
|
}
|
|
|
|
|
|
let liXianTime = User.getLiXianTime()
|
|
let curTime = new Date().getTime()
|
|
|
|
//实际离线秒数
|
|
let youXiaoTime = Math.floor((curTime - liXianTime)/1000)
|
|
|
|
//最少离线时间
|
|
let minTime = 60*5
|
|
//最多离线时间
|
|
let maxTime = 60*20
|
|
|
|
if(youXiaoTime >= maxTime){
|
|
return perSecondMoney*maxTime
|
|
}else if(youXiaoTime >= minTime){
|
|
return perSecondMoney*youXiaoTime
|
|
}else{
|
|
return 0
|
|
}
|
|
}
|
|
}
|
|
|