Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
743c55a1
Commit
743c55a1
authored
Oct 16, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/jiaoneiqunuan' into jiaoneiqunuan
parents
2ef6cd16
9e93f972
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
pagegamemain.js
taobao_jn/client/pages/pagegamemain/pagegamemain.js
+20
-9
No files found.
taobao_jn/client/pages/pagegamemain/pagegamemain.js
View file @
743c55a1
...
...
@@ -230,7 +230,7 @@ Page({
},
4000
);
},
//新ai逻辑,tool==使用道具,task==任务,invite==邀请人
async
newAiControl
(
type
=
"tool"
,
ainum
=
1
)
{
async
newAiControl
(
type
=
"tool"
,
ainum
=
1
,
aiwarm
=
0
)
{
let
canwin
=
this
.
data
.
canwin
;
let
roomnums
=
this
.
data
.
roomnums
-
1
;
let
roomdata
=
this
.
data
.
roomdata
;
...
...
@@ -243,15 +243,15 @@ Page({
let
fromedir
=
Math
.
random
();
if
(
fromedir
<
0.5
)
{
for
(
let
i
=
0
;
i
<
roomdata
.
length
;
i
++
)
{
havechao
=
this
.
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
,
ainum
);
havechao
=
this
.
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
,
ainum
,
aiwarm
);
}
}
else
{
for
(
let
i
=
roomdata
.
length
-
1
;
i
>
-
1
;
i
--
)
{
havechao
=
this
.
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
,
ainum
);
havechao
=
this
.
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
,
ainum
,
aiwarm
);
}
}
},
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
=
"tool"
,
ainum
=
1
)
{
newAiControl1
(
i
,
canwin
,
roomnums
,
roomdata
,
myidx
,
mywd
,
havechao
,
type
=
"tool"
,
ainum
=
1
,
aiwarm
=
0
)
{
if
(
i
==
myidx
)
{
}
else
{
...
...
@@ -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
*
task
warm
+
iwd
;
let
tonum
=
addcha
warm
+
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment