Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
8aef64a7
Commit
8aef64a7
authored
Jul 27, 2023
by
Nemo Ma
Committed by
GitHub
Jul 27, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #196 from winddramon/nachster
domo, lastgb.htm=san,
parents
538558d4
acc32e4d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
include/system.func.php
include/system.func.php
+14
-9
templates/default/alive.htm
templates/default/alive.htm
+1
-1
templates/default/gbresult.htm
templates/default/gbresult.htm
+1
-0
templates/default/lastgb.htm
templates/default/lastgb.htm
+0
-2
No files found.
include/system.func.php
View file @
8aef64a7
...
...
@@ -554,7 +554,7 @@ function gameover($time = 0, $mode = '', $winname = '') {
rs_sttime
();
//重置游戏开始时间和当前游戏状态
$gamestate
=
0
;
save_gameinfo
();
save_gameinfo
();
//先保存一次免得后面的处理过程太长,尽可能避免脏数据
//echo '**游戏结束**';
//$gamestate = 0;
//addnews($time, "end$winmode" , $winner);
...
...
@@ -576,6 +576,7 @@ function gameover($time = 0, $mode = '', $winname = '') {
//rs_sttime();
//save_gameinfo();
set_credits
();
save_gameinfo
();
//set_credits()里也有修改$gamevars的需求,再存一次,反正就一条记录读写不可能高并发
return
;
}
...
...
@@ -965,10 +966,11 @@ function get_credit_up($data,$winner = '',$winmode = 0){
return
$up
;
}
//判定赌局结果的烂代码
function
get_gambling_result
(
$clist
,
$winner
=
''
,
$winmode
=
''
){
global
$db
,
$tablepre
,
$gtablepre
,
$hdamage
,
$validnum
,
$now
,
$areanum
,
$areaadd
;
global
$db
,
$tablepre
,
$gtablepre
,
$hdamage
,
$validnum
,
$now
,
$areanum
,
$areaadd
,
$gamevars
;
$gblog
=
''
;
$gbfile
=
GAME_ROOT
.
TPLDIR
.
'/lastgb.htm'
;
//
$gbfile = GAME_ROOT.TPLDIR.'/lastgb.htm';
if
(
!
in_array
(
$winmode
,
Array
(
2
,
3
,
5
,
7
))){
//无人获胜,全部赌注被冴冴吃掉
$gblog
.=
'无人获胜,全部切糕被冴冴吃掉!'
;
$updatelist
=
false
;
...
...
@@ -998,7 +1000,7 @@ function get_gambling_result($clist, $winner='',$winmode=''){
if
(
$apm
>=
1
){
$apmnum
++
;}
}
$avrcredit
=
$creditsum
/
$validnum
;
//平均战斗力
$avrcredit
=
$creditsum
/
(
$validnum
>
0
?
$validnum
:
1
)
;
//平均战斗力
if
(
$avrcredit
>
10000
){
$creditodds
=
1.25
;}
//平均战斗力超过10000则系数为1.25,否则系数减少,平均战斗力为4000时为1.1;
else
{
$creditodds
=
round
((
1
+
$avrcredit
/
40000
)
*
1000
)
/
1000
;}
$apmodds
=
round
(
pow
(
1.02
,
$apmnum
)
*
1000
)
/
1000
;
//每有一名玩家达到60APM则乘以1.02
...
...
@@ -1074,11 +1076,14 @@ function get_gambling_result($clist, $winner='',$winmode=''){
}
}
}
ob_start
();
include
template
(
'gbresult'
);
$gbresult
=
ob_get_contents
();
ob_end_clean
();
writeover
(
$gbfile
,
$gbresult
);
//上一轮赌局结果存入gamevars
$gamevars
[
'gblog'
]
=
$gblog
;
$gamevars
[
'bwlist'
]
=
$bwlist
;
// ob_start();
// include template('gbresult');
// $gbresult = ob_get_contents();
// ob_end_clean();
// writeover($gbfile,$gbresult);
return
$updatelist
;
}
?>
templates/default/alive.htm
View file @
8aef64a7
...
...
@@ -16,7 +16,7 @@
<!--{if $gamblingon && $gamestate >= 20}-->
<p>
{template gambling}
</p>
<!--{elseif $gamblingon && $gamestate <= 10}-->
<p>
{template
lastgb
}
</p>
<p>
{template
gbresult
}
</p>
<!--{/if}-->
</form>
...
...
templates/default/gbresult.htm
View file @
8aef64a7
<!--{eval $gblog=$gamevars['gblog'];$bwlist = $gamevars['bwlist'];}-->
<h3
style=
"font-size:16pt"
class=
"lime"
>
上局切糕情况
</h3>
<div
class=
"lime"
>
$gblog
</div>
<!--{if !empty($bwlist)}-->
...
...
templates/default/lastgb.htm
deleted
100644 → 0
View file @
538558d4
<h3
style=
"font-size:16pt"
class=
"lime"
>
上局切糕情况
</h3>
<div
class=
"lime"
>
无人获胜,全部切糕被冴冴吃掉!
</div>
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