Commit 1f42a005 authored by Edwise's avatar Edwise 🍷

Merge remote-tracking branch 'refs/remotes/origin/jiaoneiqunuan' into jiaoneiqunuan

parents 418346f8 57b38c9b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -62,7 +62,7 @@
<image class="gamemtask2" src={{resList['d9ce0594-e262-4e9a-adfc-0b5b2a16d9c5'].url}} />
</view>
<scroll-view class="gameinfogro" scroll-y={{true}} scroll-animation-duration={{300}} scroll-with-animation={{true}} scroll-top={{(attionlist.length)*130}} disable-scroll={{false}} >
<view class="gameminfo{{index==(attionlist.length-1)?' aninfo':''}}" a:for="{{attionlist}}" a:key="*this" style="top:{{index*130+'rpx;'}}">
<view class="gameminfo{{index==(attionlist.length-1)?' aninfo':''}}" a:for="{{showattionlist}}" a:key="*this" style="top:{{index*130+'rpx;'}}">
<image class="gameminfobg" src={{resList['f1611c59-e6ba-4e4d-8aeb-50d3c794e98b'].url}} />
<label class="gameminfotxt">{{item.txt}}</label>
</view>
......
......@@ -36,6 +36,9 @@ Page({
attionlist: [
],
showattionlist:[
],//实际展示的list
iswin: false,//
step: 1,//阶段
//我的消息通知
......@@ -102,11 +105,12 @@ Page({
step: step,
roomnums: roomnums,
roomdata: roomdata,
attionlist: [{
txt: "游戏开始啦,共有" + roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。"
}]
attionlist:[],
showattionlist:[],
});
let attiontxt1 = "游戏开始啦,共有" + roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。";
this.addAttionTxt(attiontxt1);
this.changePashow();
this.updateAct();
// this.updateActInfo();
......@@ -126,14 +130,14 @@ Page({
let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000;
this.aiuseTool(itime1, i,chatime);
//ai邀请
let inviterange = [0,30];
let inviterange = [0,5];
let invitenums = Math.round(Math.random()*inviterange[1])+inviterange[0];
console.log("邀请的温度值",invitenums);
this.ainvite(invitenums,i);
//ai任务
let taskrange = [1,5];
let tasknums = Math.round(Math.random()*taskrange[1])+taskrange[0];
// this.ai
this.aitask(tasknums,i);
}
},
//机器使用道具
......@@ -177,7 +181,22 @@ Page({
}
},
//机器人完成任务
aitask(tasknums,i){
let chatime = Math.floor(gameatime/tasknums)*1000;
for(let i1=0;i1<tasknums;i1++){
let i1start = i1*chatime;
let i1end = (i1+1)*chatime-5000;
let rangetime = Math.floor(Math.random()*(i1end-i1start))+i1start;
setTimeout(()=>{
let itxt = "玩家"+(i+1)+"完成了一个任务,获得了"+taskwarm+"温度值";
this.addAttionTxt(itxt);
let inroomidx = i+1;
let inwd = this.data.roomdata[inroomidx]["wd"];
inwd += taskwarm;
this.updateRolewd(i+2,inwd);
},rangetime);
}
},
onShow() {
this.updateActInfo();
},
......@@ -487,9 +506,6 @@ Page({
} else {
return "";
}
if (ncount > lcount) {
let cha
}
},
//新增一条消息
addAttionTxt(txt) {
......@@ -497,8 +513,10 @@ Page({
attionlist.push({
txt: txt
});
let showattionlist = attionlist.slice(-10);
this.setData({
attionlist: attionlist
attionlist: attionlist,
showattionlist:showattionlist
});
},
//获取邀请人
......
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