Commit 9e93f972 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent b1e7847a
......@@ -273,10 +273,12 @@ Page({
if (chawd + taskwarm < 0) {
let maxadd = Math.floor((-1 - chawd) / taskwarm);
if (maxadd > 0) {
let addwarm = maxadd*toolwarm;
if (maxadd > ainum) {
maxadd = ainum;
addwarm = aiwarm
}
cando.push(["task", Math.round(Math.random() * maxadd)]);
cando.push(["task", Math.round(Math.random() * maxadd),addwarm]);
}
}
......@@ -322,10 +324,12 @@ Page({
if (type == "task") {
let chatask = (1 - chawd);
let chanum = Math.floor(chatask / taskwarm);
let addchawarm = chanum*taskwarm;
if (chanum > ainum) {
chanum = ainum;
addchawarm = aiwarm;
}
let tonum = chanum * taskwarm + iwd;
let tonum = addchawarm + iwd;
if (tonum <= mywd) {
let randivite1 = Math.round(Math.random() * 1) + 1 + Math.ceil((mywd - tonum) / invitewarm);
if (randivite1 > 0) {
......@@ -333,7 +337,7 @@ Page({
}
}
if (chanum > 0) {
bido.push(["task", chanum]);
bido.push(["task", chanum,addchawarm]);
}
}
if (type == "invite") {
......@@ -380,6 +384,7 @@ Page({
addOneAiWarm(data, i) {
let type = data[0];
let nums = data[1];
let aiwarm = data[2];
let othername = this.data.othername;
if (type == "tool") {
let itxt = othername[i] + "使用道具一次获得了" + toolwarm + "温度值";
......@@ -389,7 +394,13 @@ Page({
inwd += toolwarm;
this.updateRolewd(i + 1, inwd);
} else if (type == "task") {
let itxt = othername[i] + "完成了" + nums + "个任务,获得了" + taskwarm * nums + "温度值";
let addwarm = 0;
if(aiwarm){
addwarm = aiwarm;
}else{
addwarm = taskwarm*nums;
}
let itxt = othername[i] + "完成了" + nums + "个任务,获得了" + addwarm + "温度值";
this.addAttionTxt(itxt);
let inroomidx = i;
let inwd = this.data.roomdata[inroomidx]["wd"];
......@@ -892,7 +903,7 @@ Page({
}
}
if (taskcount > 0 && taskwarm > 0) {
this.newAiControl("task", taskcount);
this.newAiControl("task", taskcount,taskwarm);
let tasktxt = "你完成了" + taskcount + "个任务,获得了" + taskwarm + "温度值";
this.addAttionTxt(tasktxt);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment