Commit 1f42a005 authored by Edwise's avatar Edwise 🍷

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

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