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
f5697fc5
Commit
f5697fc5
authored
Mar 24, 2023
by
Nemo Ma
Committed by
GitHub
Mar 24, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #88 from hikawiier/waaagh
Add searchmemory
parents
e591301d
9d6cabf1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
259 additions
and
133 deletions
+259
-133
command.php
command.php
+33
-6
gamedata/cache/gamecfg_1.php
gamedata/cache/gamecfg_1.php
+6
-0
include/game.func.php
include/game.func.php
+74
-0
include/game/itemmain.func.php
include/game/itemmain.func.php
+25
-15
include/game/revbattle.func.php
include/game/revbattle.func.php
+5
-2
include/game/search.func.php
include/game/search.func.php
+68
-105
include/global.func.php
include/global.func.php
+25
-1
templates/default/command.htm
templates/default/command.htm
+21
-2
templates/default/corpse.htm
templates/default/corpse.htm
+2
-2
No files found.
command.php
View file @
f5697fc5
...
@@ -298,6 +298,19 @@ if($hp > 0){
...
@@ -298,6 +298,19 @@ if($hp > 0){
//$log.="【DEBUG】关闭了对话框。";
//$log.="【DEBUG】关闭了对话框。";
if
(
isset
(
$dialogue_log
[
$clbpara
[
'dialogue'
]]))
$log
.=
$dialogue_log
[
$clbpara
[
'dialogue'
]];
if
(
isset
(
$dialogue_log
[
$clbpara
[
'dialogue'
]]))
$log
.=
$dialogue_log
[
$clbpara
[
'dialogue'
]];
unset
(
$clbpara
[
'dialogue'
]);
unset
(
$clbpara
[
'noskip_dialogue'
]);
unset
(
$clbpara
[
'dialogue'
]);
unset
(
$clbpara
[
'noskip_dialogue'
]);
}
elseif
(
strpos
(
$command
,
'memory'
)
===
0
)
{
$smn
=
substr
(
$command
,
6
);
if
(
!
empty
(
$clbpara
[
'smeo'
]
&&
isset
(
$clbpara
[
'smeo'
][
$smn
]))){
$iid
=
$clbpara
[
'smeo'
][
$smn
][
0
];
$itp
=
$clbpara
[
'smeo'
][
$smn
][
1
];
lost_searchmemory
(
$smn
,
$pdata
);
if
(
$itp
==
'itm'
){
include_once
GAME_ROOT
.
'./include/game/search.func.php'
;
focus_item
(
$pdata
,
$iid
);
}
else
{
$action
=
'focus'
.
$iid
;
$command
=
'focus'
;
goto
chase_flag
;
}
}
}
}
}
elseif
(
$mode
==
'item'
)
{
}
elseif
(
$mode
==
'item'
)
{
include_once
GAME_ROOT
.
'./include/game/item2.func.php'
;
include_once
GAME_ROOT
.
'./include/game/item2.func.php'
;
...
@@ -473,6 +486,7 @@ if($hp > 0){
...
@@ -473,6 +486,7 @@ if($hp > 0){
if
(
strpos
(
$action
,
'chase'
)
===
0
)
$enemyid
=
str_replace
(
'chase'
,
''
,
$action
);
if
(
strpos
(
$action
,
'chase'
)
===
0
)
$enemyid
=
str_replace
(
'chase'
,
''
,
$action
);
if
(
strpos
(
$action
,
'pchase'
)
===
0
)
$enemyid
=
str_replace
(
'pchase'
,
''
,
$action
);
if
(
strpos
(
$action
,
'pchase'
)
===
0
)
$enemyid
=
str_replace
(
'pchase'
,
''
,
$action
);
if
(
strpos
(
$action
,
'dfight'
)
===
0
)
$enemyid
=
str_replace
(
'dfight'
,
''
,
$action
);
if
(
strpos
(
$action
,
'dfight'
)
===
0
)
$enemyid
=
str_replace
(
'dfight'
,
''
,
$action
);
if
(
strpos
(
$action
,
'focus'
)
===
0
)
$enemyid
=
str_replace
(
'focus'
,
''
,
$action
);
if
(
!
$enemyid
)
if
(
!
$enemyid
)
{
{
$log
.=
"<span class=
\"
yellow b
\"
>你没有遇到敌人,或已经离开战场!</span>
{
$enemyid
}
<br>"
;
$log
.=
"<span class=
\"
yellow b
\"
>你没有遇到敌人,或已经离开战场!</span>
{
$enemyid
}
<br>"
;
...
@@ -489,28 +503,30 @@ if($hp > 0){
...
@@ -489,28 +503,30 @@ if($hp > 0){
$log
.=
"<span class=
\"
yellow b
\"
>"
.
$edata
[
'name'
]
.
"</span>已经离开了<span class=
\"
yellow b
\"
>
$plsinfo[$pls]
</span>。<br>"
;
$log
.=
"<span class=
\"
yellow b
\"
>"
.
$edata
[
'name'
]
.
"</span>已经离开了<span class=
\"
yellow b
\"
>
$plsinfo[$pls]
</span>。<br>"
;
goto
back_flag
;
goto
back_flag
;
}
}
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
if
(
!
empty
(
$edata
[
'clbpara'
][
'lasttimes'
]))
$edata
=
check_skilllasttimes
(
$edata
);
if
(
$edata
[
'hp'
]
<=
0
)
if
(
$edata
[
'hp'
]
<=
0
)
{
{
$log
.=
"<span class=
\"
red b
\"
>"
.
$edata
[
'name'
]
.
"</span>已经死亡,不能被攻击。<br>"
;
if
(
strpos
(
$action
,
'focus'
)
===
false
)
$log
.=
"<span class=
\"
red b
\"
>"
.
$edata
[
'name'
]
.
"</span>已经死亡,不能被攻击。<br>"
;
include_once
GAME_ROOT
.
'./include/game/battle.func.php'
;
include_once
GAME_ROOT
.
'./include/game/battle.func.php'
;
$action
=
'corpse'
.
$edata
[
'pid'
];
$action
=
'corpse'
.
$edata
[
'pid'
];
findcorpse
(
$edata
);
findcorpse
(
$edata
);
}
}
elseif
(
$command
==
'changewep'
)
elseif
(
$command
==
'changewep'
)
{
{
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
change_wep_in_battle
();
change_wep_in_battle
();
findenemy_rev
(
$edata
);
findenemy_rev
(
$edata
);
}
}
elseif
(
$command
==
'chase'
)
elseif
(
$command
==
'chase'
)
{
{
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
findenemy_rev
(
$edata
);
findenemy_rev
(
$edata
);
}
}
elseif
(
$command
==
'back'
)
elseif
(
$command
==
'back'
)
{
{
//$log .= "你逃跑了。";
//$log .= "你逃跑了。";
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
$flag
=
escape_from_enemy
(
$pdata
,
$edata
);
$flag
=
escape_from_enemy
(
$pdata
,
$edata
);
if
(
$flag
)
if
(
$flag
)
{
{
...
@@ -519,10 +535,21 @@ if($hp > 0){
...
@@ -519,10 +535,21 @@ if($hp > 0){
}
}
else
else
{
{
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
rev_combat_prepare
(
$pdata
,
$edata
,
0
);
rev_combat_prepare
(
$pdata
,
$edata
,
0
);
}
}
}
}
elseif
(
$command
==
'focus'
)
{
// 迎战视野中的敌人先制率-40
$active_r
=
min
(
4
,
get_active_r_rev
(
$pdata
,
$edata
)
-
40
);
$active_dice
=
diceroll
(
99
);
if
(
$active_dice
<
$active_r
){
$action
=
'enemy'
.
$edata
[
'pid'
];
findenemy_rev
(
$edata
);
}
else
{
rev_combat_prepare
(
$edata
,
$pdata
,
0
);
}
}
else
else
{
{
if
(
!
empty
(
$message
))
$pdata
[
'message'
]
=
$message
;
if
(
!
empty
(
$message
))
$pdata
[
'message'
]
=
$message
;
...
...
gamedata/cache/gamecfg_1.php
View file @
f5697fc5
...
@@ -43,6 +43,12 @@ $searchcoldtime=873;
...
@@ -43,6 +43,12 @@ $searchcoldtime=873;
//使用物品的冷却时间,单位微秒
//使用物品的冷却时间,单位微秒
$itemusecoldtime
=
555
;
$itemusecoldtime
=
555
;
//探索记忆↔视野系统
//是否开启探索记忆功能 1 = 开启;0 = 关闭;
$allow_semo
=
1
;
//视野内最多可保留内容:3项
$smeo_max
=
3
;
//胜率榜最小参赛次数
//胜率榜最小参赛次数
$winratemingames
=
50
;
$winratemingames
=
50
;
//是否启动赌注系统?0为不启动,1为启动;
//是否启动赌注系统?0为不启动,1为启动;
...
...
include/game.func.php
View file @
f5697fc5
...
@@ -473,6 +473,80 @@ function init_clubskillsdata($sk,$data)
...
@@ -473,6 +473,80 @@ function init_clubskillsdata($sk,$data)
return
0
;
return
0
;
}
}
function
check_add_searchmemory
(
$id
,
$itp
,
$nm
,
&
$data
=
NULL
)
{
global
$allow_semo
,
$smeo_max
,
$log
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
$allow_semo
)
{
$now_smeo
=
empty
(
$data
[
'clbpara'
][
'smeo'
])
?
0
:
count
(
$data
[
'clbpara'
][
'smeo'
]);
if
(
$now_smeo
>=
$smeo_max
)
{
lost_searchmemory
(
NULL
,
$data
);
}
$nm_desc
=
$itp
==
'corpse'
?
$nm
.
'的尸体'
:
$nm
;
$flag
=
0
;
if
(
empty
(
$data
[
'clbpara'
][
'smeo'
]))
{
$data
[
'clbpara'
][
'smeo'
]
=
Array
();
}
else
{
foreach
(
$data
[
'clbpara'
][
'smeo'
]
as
$sid
=>
$sm
)
{
if
(
$sm
[
0
]
==
$id
&&
$sm
[
1
]
==
$itp
)
{
$log
.=
"<span class='grey'>
{
$nm_desc
}
本来就在你的视野里,不过这回你对它的印象更深了。</span><br>"
;
lost_searchmemory
(
$sid
,
$data
);
$flag
=
1
;
break
;
}
}
}
array_push
(
$data
[
'clbpara'
][
'smeo'
],
Array
(
$id
,
$itp
,
$nm
));
if
(
!
$flag
)
$log
.=
"<span class='grey'>你设法将
{
$nm_desc
}
保持在视野范围内。</span><br>"
;
}
return
;
}
function
lost_searchmemory
(
$key
=
NULL
,
&
$data
=
NULL
)
{
global
$allow_semo
,
$smeo_max
,
$log
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
!
empty
(
$data
[
'clbpara'
][
'smeo'
]))
{
if
(
$key
==
'all'
)
{
$data
[
'clbpara'
][
'smeo'
]
=
Array
();
$log
.=
'<span class="grey">你先前所见的一切东西都离开了视线。</span><br>'
;
}
elseif
(
isset
(
$key
))
{
unset
(
$data
[
'clbpara'
][
'smeo'
][
$key
]);
}
else
{
$n0
=
reset
(
$data
[
'clbpara'
][
'smeo'
]);
$n0_nm_desc
=
$n0
[
1
]
==
'corpse'
?
$n0
[
2
]
.
'的尸体'
:
$n0
[
2
];
$log
.=
"<span class=
\"
grey
\"
>
{
$n0_nm_desc
}
从你的视野里消失了。</span><br>"
;
array_shift
(
$data
[
'clbpara'
][
'smeo'
]);
}
}
return
;
}
function
get_remaincdtime
(
$pid
){
function
get_remaincdtime
(
$pid
){
$psdata
=
get_pstate
(
$pid
);
$psdata
=
get_pstate
(
$pid
);
if
(
$psdata
){
if
(
$psdata
){
...
...
include/game/itemmain.func.php
View file @
f5697fc5
...
@@ -532,17 +532,18 @@ function itemdrop($item,&$data=NULL) {
...
@@ -532,17 +532,18 @@ function itemdrop($item,&$data=NULL) {
$mode
=
'command'
;
$mode
=
'command'
;
return
;
return
;
}
}
if
(
strpos
(
$itmsk
,
'v'
)
!==
false
){
if
(
strpos
(
$itmsk
,
'v'
)
!==
false
)
{
$log
.=
"
{
$itm
}
在地上化作点点碎片,随风消逝了。<br>"
;
$log
.=
"
{
$itm
}
在地上化作点点碎片,随风消逝了。<br>"
;
$log
.=
"你摧毁了<span class=
\"
red
\"
>
$itm
</span>。<br>"
;
$log
.=
"你摧毁了<span class=
\"
red
\"
>
$itm
</span>。<br>"
;
}
else
{
}
// $mapfile = GAME_ROOT."./gamedata/mapitem/{$pls}mapitem.php";
else
// $itemdata = "$itm,$itmk,$itme,$itms,$itmsk,\n";
{
// writeover($mapfile,$itemdata,'ab');
$db
->
query
(
"INSERT INTO
{
$tablepre
}
mapitem (itm, itmk, itme, itms, itmsk ,pls) VALUES ('
$itm
', '
$itmk
', '
$itme
', '
$itms
', '
$itmsk
', '
$pls
')"
);
$db
->
query
(
"INSERT INTO
{
$tablepre
}
mapitem (itm, itmk, itme, itms, itmsk ,pls) VALUES ('
$itm
', '
$itmk
', '
$itme
', '
$itms
', '
$itmsk
', '
$pls
')"
);
$drop_iid
=
$db
->
insert_id
();
$log
.=
"你丢弃了<span class=
\"
red
\"
>
$itm
</span>。<br>"
;
$log
.=
"你丢弃了<span class=
\"
red
\"
>
$itm
</span>。<br>"
;
check_add_searchmemory
(
$drop_iid
,
'itm'
,
$itm
,
$data
);
}
}
$mode
=
'command'
;
if
(
$item
==
'wep'
){
if
(
$item
==
'wep'
){
$itm
=
'拳头'
;
$itm
=
'拳头'
;
$itmsk
=
''
;
$itmsk
=
''
;
...
@@ -553,6 +554,7 @@ function itemdrop($item,&$data=NULL) {
...
@@ -553,6 +554,7 @@ function itemdrop($item,&$data=NULL) {
$itm
=
$itmk
=
$itmsk
=
''
;
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
$itme
=
$itms
=
0
;
}
}
$mode
=
'command'
;
return
;
return
;
}
}
...
@@ -1304,6 +1306,14 @@ function getcorpse($item,&$data=NULL)
...
@@ -1304,6 +1306,14 @@ function getcorpse($item,&$data=NULL)
$mode
=
'command'
;
$mode
=
'command'
;
return
;
return
;
}
}
elseif
(
$item
==
'back'
)
{
//没有从尸体上捡取道具时,保留视野
check_add_searchmemory
(
$edata
[
'pid'
],
'corpse'
,
$edata
[
'name'
],
$data
);
$action
=
''
;
$mode
=
'command'
;
return
;
}
if
(
$item
==
'cstick'
)
if
(
$item
==
'cstick'
)
{
{
...
...
include/game/revbattle.func.php
View file @
f5697fc5
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
//战斗中逃跑
//战斗中逃跑
function
escape_from_enemy
(
&
$pa
,
&
$pd
)
function
escape_from_enemy
(
&
$pa
,
&
$pd
)
{
{
global
$action
,
$clbpara
,
$chase_escape_obbs
,
$log
;
global
$
fog
,
$
action
,
$clbpara
,
$chase_escape_obbs
,
$log
;
//include_once GAME_ROOT.'./include/game/dice.func.php';
//include_once GAME_ROOT.'./include/game/dice.func.php';
# 在受追击/鏖战状态下逃跑有概率失败
# 在受追击/鏖战状态下逃跑有概率失败
if
(
strpos
(
$action
,
'pchase'
)
===
0
||
strpos
(
$action
,
'dfight'
)
===
0
)
if
(
strpos
(
$action
,
'pchase'
)
===
0
||
strpos
(
$action
,
'dfight'
)
===
0
)
...
@@ -190,8 +190,11 @@
...
@@ -190,8 +190,11 @@
return
0
;
return
0
;
}
}
}
}
$log
.=
"你逃跑了。"
;
$log
.=
"你逃跑了。
<br>
"
;
$action
=
''
;
$action
=
''
;
//逃跑后在视野里记录敌人
$nm
=
$fog
?
'???'
:
$pd
[
'name'
];
check_add_searchmemory
(
$pd
[
'pid'
],
'enemy'
,
$nm
,
$pa
);
unset
(
$clbpara
[
'battle_turns'
]);
unset
(
$clbpara
[
'battle_turns'
]);
return
1
;
return
1
;
}
}
...
...
include/game/search.func.php
View file @
f5697fc5
...
@@ -162,6 +162,10 @@ function move($moveto = 99,&$data=NULL) {
...
@@ -162,6 +162,10 @@ function move($moveto = 99,&$data=NULL) {
$log
.=
"高强度的紫外线灼烧着大地……<br>"
;
$log
.=
"高强度的紫外线灼烧着大地……<br>"
;
}
}
}
}
//移动后丢失探索视野
lost_searchmemory
(
'all'
,
$data
);
if
(
!
$moved
)
{
if
(
!
$moved
)
{
if
(
!
$hpls_flag
)
$pgroup
=
0
;
if
(
!
$hpls_flag
)
$pgroup
=
0
;
$pls
=
$moveto
;
$pls
=
$moveto
;
...
@@ -353,32 +357,6 @@ function search(&$data=NULL){
...
@@ -353,32 +357,6 @@ function search(&$data=NULL){
}
}
}
}
}
}
/*if(strpos($inf, 'p') !== false){
$damage = round($mhp/32) + rand(0,5);
$hp -= $damage;
$log .= "<span class=\"purple\">毒发</span>减少了<span class=\"red\">$damage</span>点生命!<br>";
if($hp <= 0 ){
include_once GAME_ROOT.'./include/state.func.php';
death('pmove');
return;
}
}
if(strpos($inf, 'u') !== false){
$damage = round($mhp/32) + rand(0,15);
$hp -= $damage;
$log .= "<span class=\"yellow\">烧伤发作</span>减少了<span class=\"red\">$damage</span>点生命!<br>";
if($hp <= 0 ){
include_once GAME_ROOT.'./include/state.func.php';
death('umove');
return;
}
}*/
/*$enemyrate = 40;
if($gamestate == 40){$enemyrate += 20;}
elseif($gamestate == 50){$enemyrate += 30;}
if($pose==3){$enemyrate -= 20;}
elseif($pose==4){$enemyrate += 10;}*/
include_once
GAME_ROOT
.
'./include/game/revattr.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revattr.func.php'
;
$enemyrate
=
calc_meetman_rate
(
$data
);
$enemyrate
=
calc_meetman_rate
(
$data
);
//echo "enemyrate = {$enemyrate}%";
//echo "enemyrate = {$enemyrate}%";
...
@@ -475,49 +453,6 @@ function discover($schmode = 0,&$data=NULL)
...
@@ -475,49 +453,6 @@ function discover($schmode = 0,&$data=NULL)
itemfind
(
$data
);
itemfind
(
$data
);
return
;
return
;
}
}
/*if($xtrpflag){
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
$itm0=$xtrp['itm'];
$itmk0=$xtrp['itmk'];
$itme0=$xtrp['itme'];
$itms0=$xtrp['itms'];
$itmsk0=$xtrp['itmsk'];
$tid = $xtrp['tid'];
$db->query("DELETE FROM {$tablepre}maptrap WHERE tid='$tid'");
itemfind();
return;
}else{
$real_trap_obbs = $trap_min_obbs + $trpnum/4;
//Anti-Meta RP System Version 2.00 ~ Nemo
//冴冴我喜欢你!
//17rp/177rp+1%
if($gamestate >= 50) {$real_trap_obbs = $real_trap_obbs + $rp / 177; }
else{ $real_trap_obbs = $real_trap_obbs + $rp/30; }
if($pose==1){$real_trap_obbs+=1;}
elseif($pose==3){$real_trap_obbs+=3;}//攻击和探索姿势略容易踩陷阱
if($gamestate >= 40){$real_trap_obbs+=3;}//连斗以后略容易踩陷阱
if($pls == 0){$real_trap_obbs+=15;}//在后台非常容易踩陷阱
if($club == 6){$real_trap_obbs-=5;}//人肉搜索称号遭遇陷阱概率减少
if($trap_dice < $real_trap_obbs){//踩陷阱判断
$itemno = rand(0,$trpnum-1);
$db->data_seek($trapresult,$itemno);
$mi=$db->fetch_array($trapresult);
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
$itm0=$mi['itm'];
$itmk0=$mi['itmk'];
$itme0=$mi['itme'];
$itms0=$mi['itms'];
$itmsk0=$mi['itmsk'];
$tid=$mi['tid'];
$db->query("DELETE FROM {$tablepre}maptrap WHERE tid='$tid'");
if($itms0){
include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemfind();
return;
}
}
}*/
}
}
}
}
include_once
GAME_ROOT
.
'./include/game/attr.func.php'
;
include_once
GAME_ROOT
.
'./include/game/attr.func.php'
;
...
@@ -621,11 +556,6 @@ function discover($schmode = 0,&$data=NULL)
...
@@ -621,11 +556,6 @@ function discover($schmode = 0,&$data=NULL)
else
else
{
{
battle_flag
:
battle_flag
:
//$active_r = get_active_r($weather,$pls,$pose,$tactic,$club,$inf,$edata['pose']);
//include_once GAME_ROOT.'./include/game/clubskills.func.php';
//$active_r *= get_clubskill_bonus_active($club,$skills,$edata['club'],$edata['skills']);
//if ($active_r>96) $active_r=96;
//include_once GAME_ROOT.'./include/game/dice.func.php';
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revbattle.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
//刷新敌人时效性状态
//刷新敌人时效性状态
...
@@ -691,18 +621,55 @@ function discover($schmode = 0,&$data=NULL)
...
@@ -691,18 +621,55 @@ function discover($schmode = 0,&$data=NULL)
$find_r
=
get_find_r
(
$weather
,
$pls
,
$pose
,
$tactic
,
$club
,
$inf
);
$find_r
=
get_find_r
(
$weather
,
$pls
,
$pose
,
$tactic
,
$club
,
$inf
);
$find_obbs
=
$item_obbs
+
$find_r
;
$find_obbs
=
$item_obbs
+
$find_r
;
$item_dice
=
rand
(
0
,
99
);
$item_dice
=
rand
(
0
,
99
);
if
(
$item_dice
<
$find_obbs
)
{
if
(
$item_dice
<
$find_obbs
)
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
mapitem WHERE pls = '
$pls
'"
);
{
$itemnum
=
$db
->
num_rows
(
$result
);
$flag
=
focus_item
(
$data
);
if
(
$itemnum
<=
0
){
if
(
!
$flag
)
{
$log
.=
'<span class="yellow">周围找不到任何物品。</span><br>'
;
$log
.=
'<span class="yellow">周围找不到任何物品。</span><br>'
;
$mode
=
'command'
;
$mode
=
'command'
;
return
;
return
;
}
}
}
else
{
$log
.=
"但是什么都没有发现。<br>"
;
}
}
$mode
=
'command'
;
return
;
}
function
focus_item
(
&
$data
=
NULL
,
$id
=
NULL
)
{
global
$db
,
$tablepre
,
$log
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
isset
(
$id
))
{
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
mapitem WHERE pls = '
$pls
' AND iid = '
$id
'"
);
if
(
!
$db
->
num_rows
(
$result
))
{
$log
.=
"但是你想找的东西已经不见了!<br>"
;
return
0
;
}
$mi
=
$db
->
fetch_array
(
$result
);
}
else
{
$result
=
$db
->
query
(
"SELECT * FROM
{
$tablepre
}
mapitem WHERE pls = '
$pls
'"
);
$itemnum
=
$db
->
num_rows
(
$result
);
if
(
$itemnum
<=
0
)
return
0
;
$itemno
=
rand
(
0
,
$itemnum
-
1
);
$itemno
=
rand
(
0
,
$itemnum
-
1
);
$db
->
data_seek
(
$result
,
$itemno
);
$db
->
data_seek
(
$result
,
$itemno
);
$mi
=
$db
->
fetch_array
(
$result
);
$mi
=
$db
->
fetch_array
(
$result
);
//global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
}
$itm0
=
$mi
[
'itm'
];
$itm0
=
$mi
[
'itm'
];
$itmk0
=
$mi
[
'itmk'
];
$itmk0
=
$mi
[
'itmk'
];
$itme0
=
$mi
[
'itme'
];
$itme0
=
$mi
[
'itme'
];
...
@@ -710,8 +677,8 @@ function discover($schmode = 0,&$data=NULL)
...
@@ -710,8 +677,8 @@ function discover($schmode = 0,&$data=NULL)
$itmsk0
=
$mi
[
'itmsk'
];
$itmsk0
=
$mi
[
'itmsk'
];
$iid
=
$mi
[
'iid'
];
$iid
=
$mi
[
'iid'
];
$db
->
query
(
"DELETE FROM
{
$tablepre
}
mapitem WHERE iid='
$iid
'"
);
$db
->
query
(
"DELETE FROM
{
$tablepre
}
mapitem WHERE iid='
$iid
'"
);
if
(
$itms0
)
if
(
$itms0
)
{
{
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
if
(
$data
[
'pass'
]
==
'bot'
)
if
(
$data
[
'pass'
]
==
'bot'
)
{
{
...
@@ -720,18 +687,14 @@ function discover($schmode = 0,&$data=NULL)
...
@@ -720,18 +687,14 @@ function discover($schmode = 0,&$data=NULL)
else
else
{
{
itemfind
();
itemfind
();
return
;
return
1
;
}
}
}
else
{
$log
.=
"但是什么都没有发现。可能是因为道具有天然呆属性。<br>"
;
}
}
else
{
$log
.=
"但是什么都没有发现。<br>"
;
}
}
else
{
$log
.=
"但是什么都没有发现。可能是因为道具有天然呆属性。<br>"
;
}
}
$mode
=
'command'
;
return
;
return
;
}
}
...
...
include/global.func.php
View file @
f5697fc5
...
@@ -562,7 +562,7 @@ function player_format_with_db_structure($data){
...
@@ -562,7 +562,7 @@ function player_format_with_db_structure($data){
$db_player_structure
=
update_db_player_structure
();
$db_player_structure
=
update_db_player_structure
();
foreach
(
$db_player_structure
as
$key
)
foreach
(
$db_player_structure
as
$key
)
{
{
if
(
isset
(
$data
[
$key
])
&&
is_array
(
$data
[
$key
]))
$data
[
$key
]
=
json_encode
(
$data
[
$key
]);
if
(
isset
(
$data
[
$key
])
&&
is_array
(
$data
[
$key
]))
$data
[
$key
]
=
json_encode
(
$data
[
$key
]
,
JSON_UNESCAPED_UNICODE
);
$ndata
[
$key
]
=
isset
(
$data
[
$key
])
?
$data
[
$key
]
:
''
;
$ndata
[
$key
]
=
isset
(
$data
[
$key
])
?
$data
[
$key
]
:
''
;
}
}
return
$ndata
;
return
$ndata
;
...
@@ -679,6 +679,23 @@ function parse_info_desc($info,$type,$vars='',$short=0,$tiptype=0)
...
@@ -679,6 +679,23 @@ function parse_info_desc($info,$type,$vars='',$short=0,$tiptype=0)
return
$info
;
return
$info
;
}
}
//省略显示
//显示宽度20英文字符,假设汉字的显示宽度大约是英文字母的1.8倍
function
parse_itmname_words
(
$name_value
,
$elli
=
0
,
$width
=
20
,
$end
=
1
){
if
(
!
$elli
)
return
$name_value
;
if
(
$width
<=
6
)
$width
=
6
;
$ilen
=
mb_strlen
(
$name_value
);
$slen
=
0
;
for
(
$i
=
0
;
$i
<
$ilen
;
$i
++
){
$c
=
mb_substr
(
$name_value
,
$i
,
1
);
if
(
strlen
(
$c
)
>
mb_strlen
(
$c
))
$slen
+=
1.8
;
//是汉字或别的UTF-8字符,显示宽度+1.8
else
$slen
+=
1
;
//是英文字母或其他ascii字符,显示宽度+1
if
(
$slen
>=
$width
)
break
;
}
if
(
$i
==
$ilen
)
return
$name_value
;
else
return
middle_abbr
(
$name_value
,
$i
-
1
,
$end
);
}
//----------------------------------------
//----------------------------------------
// 字符串处理
// 字符串处理
//----------------------------------------
//----------------------------------------
...
@@ -815,6 +832,13 @@ function gdecode($para, $assoc = false){
...
@@ -815,6 +832,13 @@ function gdecode($para, $assoc = false){
else
return
json_decode
(
mgzdecode
(
base64_decode
(
$para
)),
$assoc
);
else
return
json_decode
(
mgzdecode
(
base64_decode
(
$para
)),
$assoc
);
}
}
//字符串中段省略,取头部+尾部1字符
function
middle_abbr
(
$str
,
$len1
,
$len2
=
1
,
$elli
=
'...'
)
{
$str
=
(
string
)
$str
;
$len1
=
(
int
)
$len1
;
$len2
=
(
int
)
$len2
;
return
mb_substr
(
$str
,
0
,
$len1
)
.
$elli
.
mb_substr
(
$str
,
-
$len2
,
$len2
);
}
//mb_strlen()兼容替代函数,直接照抄的网络
//mb_strlen()兼容替代函数,直接照抄的网络
if
(
!
function_exists
(
'mb_strlen'
)
)
{
if
(
!
function_exists
(
'mb_strlen'
)
)
{
function
mb_strlen
(
$text
,
$encode
=
'UTF-8'
)
{
function
mb_strlen
(
$text
,
$encode
=
'UTF-8'
)
{
...
...
templates/default/command.htm
View file @
f5697fc5
...
@@ -7,8 +7,27 @@
...
@@ -7,8 +7,27 @@
<select
id=
"moveto"
name=
"moveto"
onchange=
"$('command').value='move';postCmd('gamecmd','command.php');this.disabled=true;"
>
<select
id=
"moveto"
name=
"moveto"
onchange=
"$('command').value='move';postCmd('gamecmd','command.php');this.disabled=true;"
>
{template move}
{template move}
</select>
</select>
<br
/>
<!-- 探索记忆栏 -->
<br
/>
<!--{if !empty($clbpara['smeo'])}-->
<br>
<!--{loop $clbpara['smeo'] $smkey $sm}-->
<input
type=
"button"
class=
"cmdbutton"
style=
"padding: 0px; margin-top: 15px;"
<!
--
{
eval
$
sm_nm =
parse_itmname_words($sm[2],1,10);
}
--
>
<!--{if $sm[1] == 'itm'}-->
value="获取 {$sm_nm}"
<!--{elseif $sm[1] == 'enemy'}-->
value="迎战 {$sm_nm}"
<!--{elseif $sm[1] == 'corpse'}-->
value="检查 {$sm_nm} 的尸体"
<!--{elseif $sm[1] == 'corpse'}-->
value="和 {$sm_nm} 打招呼"
<!--{/if}-->
onclick="$('mode').value='command';$('command').value='memory{$smkey}';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/loop}-->
<!--{/if}-->
<br
/>
<!-- 背包栏 -->
<br
/>
<!--{if $itms1}-->
<!--{if $itms1}-->
<input
type=
"button"
id=
"11"
class=
"cmdbutton"
<!
--
{
if
strpos
($
itmk1
,'
W
'
)=
==0
||
strpos
($
itmk1
,'
D
'
)=
==0
||
strpos
($
itmk1
,'
A
'
)=
==0}--
>
value="[1]装备"
<!--{else}-->
value="[1]使用"
<!--{/if}-->
onclick="$('mode').value='command';$('command').value='itm1';postCmd('gamecmd','command.php');this.disabled=true;">
<span
class=
"yellow"
>
{$itm1}
</span>
/{$itme1}/{$itms1}
<br>
<input
type=
"button"
id=
"11"
class=
"cmdbutton"
<!
--
{
if
strpos
($
itmk1
,'
W
'
)=
==0
||
strpos
($
itmk1
,'
D
'
)=
==0
||
strpos
($
itmk1
,'
A
'
)=
==0}--
>
value="[1]装备"
<!--{else}-->
value="[1]使用"
<!--{/if}-->
onclick="$('mode').value='command';$('command').value='itm1';postCmd('gamecmd','command.php');this.disabled=true;">
<span
class=
"yellow"
>
{$itm1}
</span>
/{$itme1}/{$itms1}
<br>
<!--{/if}-->
<!--{/if}-->
...
...
templates/default/corpse.htm
View file @
f5697fc5
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!--{if $loot_depot_flag}-->
<!--{if $loot_depot_flag}-->
<input
type=
"radio"
name=
"command"
id=
"loot_depot"
value=
"loot_depot"
><a
onclick=
sl('loot_depot');
href=
"javascript:void(0);"
>
转移安全箱权限
</a><br>
<input
type=
"radio"
name=
"command"
id=
"loot_depot"
value=
"loot_depot"
><a
onclick=
sl('loot_depot');
href=
"javascript:void(0);"
>
转移安全箱权限
</a><br>
<!--{/if}-->
<!--{/if}-->
<input
type=
"radio"
name=
"command"
id=
"
menu"
value=
"menu"
<!
--
{
if
!$
w_money
&&
$
club
!=
20
&&
!$
allow_destory_corpse
}
--
>
checked
<!--{/if}-->
>
<a
onclick=
sl('menu
');
href=
"javascript:void(0);"
>
返回
</a><br><br>
<input
type=
"radio"
name=
"command"
id=
"
back"
value=
"back"
<!
--
{
if
!$
w_money
&&
$
club
!=
20
&&
!$
allow_destory_corpse
}
--
>
checked
<!--{/if}-->
>
<a
onclick=
sl('back
');
href=
"javascript:void(0);"
>
返回
</a><br><br>
<!--{if $w_weps && $w_wepe}-->
<!--{if $w_weps && $w_wepe}-->
<input
type=
"radio"
name=
"command"
id=
"wep"
value=
"wep"
><a
onclick=
sl('wep');
href=
"javascript:void(0);"
>
$w_wep/$w_wepk_words/$w_wepe/$w_weps
<!--{if $w_wepsk_words}-->
/$w_wepsk_words
<!--{/if}-->
</a><br>
<input
type=
"radio"
name=
"command"
id=
"wep"
value=
"wep"
><a
onclick=
sl('wep');
href=
"javascript:void(0);"
>
$w_wep/$w_wepk_words/$w_wepe/$w_weps
<!--{if $w_wepsk_words}-->
/$w_wepsk_words
<!--{/if}-->
</a><br>
<!--{/if}-->
<!--{/if}-->
...
@@ -55,4 +55,4 @@
...
@@ -55,4 +55,4 @@
<input
type=
"radio"
name=
"command"
id=
"money"
value=
"money"
checked
><a
onclick=
sl('money');
href=
"javascript:void(0);"
>
$w_money {lang moneyunit}
</a><br>
<input
type=
"radio"
name=
"command"
id=
"money"
value=
"money"
checked
><a
onclick=
sl('money');
href=
"javascript:void(0);"
>
$w_money {lang moneyunit}
</a><br>
<!--{/if}-->
<!--{/if}-->
<input
type=
"button"
id=
"zz"
name=
"submit"
value=
"[Z]提交"
onclick=
"postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
id=
"zz"
name=
"submit"
class=
"cmdbutton"
style=
"margin-top: 15px; width: 70px;"
value=
"[Z]提交"
onclick=
"postCmd('gamecmd','command.php');this.disabled=true;"
>
\ No newline at end of file
\ No newline at end of file
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