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
6bded008
Commit
6bded008
authored
Mar 30, 2023
by
Nemo Ma
Committed by
GitHub
Mar 30, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #98 from hikawiier/waaagh
update eeelements
parents
be8e15e9
58650d2e
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1353 additions
and
984 deletions
+1353
-984
command.php
command.php
+10
-34
gamedata/cache/clubskills_1.php
gamedata/cache/clubskills_1.php
+1
-0
gamedata/cache/elementmix_1.php
gamedata/cache/elementmix_1.php
+70
-34
gamedata/cache/resources_1.php
gamedata/cache/resources_1.php
+9
-0
include/game/achievement.func.php
include/game/achievement.func.php
+2
-2
include/game/elementmix.calc.php
include/game/elementmix.calc.php
+710
-0
include/game/elementmix.func.php
include/game/elementmix.func.php
+339
-830
include/game/item.func.php
include/game/item.func.php
+16
-17
include/game20130526.js
include/game20130526.js
+34
-0
templates/default/command.htm
templates/default/command.htm
+1
-3
templates/default/elementmix.htm
templates/default/elementmix.htm
+57
-42
templates/default/help.htm
templates/default/help.htm
+3
-1
templates/default/itemdrop.htm
templates/default/itemdrop.htm
+5
-1
templates/default/itemfind.htm
templates/default/itemfind.htm
+1
-1
templates/default/itemmix_tips.htm
templates/default/itemmix_tips.htm
+95
-19
No files found.
command.php
View file @
6bded008
...
...
@@ -157,16 +157,14 @@ if($hp > 0){
if
((
$club
==
20
&&
$itemcmd
==
'itemmix'
)
||
(
$club
!=
20
&&
(
$itemcmd
==
'elementmix'
||
$itemcmd
==
'elementbag'
))){
$log
.=
"你的手突然掐住了你的头左右摇摆!<br><span class='yellow'>“你还想要干什么,啊?你还想要干什么!!”</span><br>看来你的手和脑子之间起了一点小摩擦。<br><br>"
;
$mode
=
'command'
;
}
else
{
if
(
$club
==
20
){
global
$elements_info
;
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
$emax
=
get_emix_itme_max
();
foreach
(
$elements_info
as
$e_key
=>
$e_info
)
$
{
'etaginfo'
.
$e_key
}
=
"<span tooltip=
\"
"
.
print_elements_tags
(
$e_key
)
.
"
\"
>"
;
}
elseif
(
$itemcmd
==
'itemmix'
){
}
else
{
if
(
$itemcmd
==
'itemmix'
||
$itemcmd
==
'elementmix'
){
$main
=
'itemmix_tips'
;
}
if
(
$club
==
20
){
include_once
GAME_ROOT
.
'./include/game/elementmix.calc.php'
;
$emax
=
emix_calc_maxenum
();
}
$mode
=
$itemcmd
;
}
}
elseif
(
$command
==
'song'
)
{
...
...
@@ -328,7 +326,6 @@ if($hp > 0){
}
elseif
(
$command
==
'itemmove'
)
{
itemmove
(
$from
,
$to
);
}
elseif
(
strpos
(
$command
,
'split_itm'
)
===
0
)
{
//把道具分解为元素 在数据库里注销道具的流程已经在discover()里走完了
$split_item
=
substr
(
$command
,
9
);
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
split_item_to_elements
(
$split_item
);
...
...
@@ -367,31 +364,10 @@ if($hp > 0){
else
itemmix_rev
(
$mixlist
);
}
}
elseif
(
$command
==
'elementmix'
)
{
if
(
$club
==
20
){
$e_mixlist
=
Array
();
foreach
(
$elements_info
as
$e_key
=>
$e_info
){
global
$
{
'element'
.
$e_key
};
$m_e_key
=
$e_key
+
1
;
//这样就不用污染原本的js了
if
(
isset
(
$
{
'emitm'
.
$e_key
.
'_num'
}))
$
{
'emitm'
.
$e_key
.
'_num'
}
=
round
(
$
{
'emitm'
.
$e_key
.
'_num'
});
if
(
$
{
'mitm'
.
$m_e_key
}
>=
0
&&
$
{
'element'
.
$e_key
}
&&
$
{
'emitm'
.
$e_key
.
'_num'
}
>
0
&&
$
{
'emitm'
.
$e_key
.
'_num'
}
<=
$
{
'element'
.
$e_key
}){
$e_mixlist
[
$e_key
]
=
$
{
'emitm'
.
$e_key
.
'_num'
};
//打入参与合成的元素编号与数量
}
}
if
(
count
(
$e_mixlist
)
>
0
){
$er
=
(
$lvl
>=
15
&&
$emitme_r
&&
$change_emr
>
0
)
?
$emitme_r
:
NULL
;
$emr
=
(
$lvl
>=
5
&&
$emitme_max_r
&&
$change_emax
>
0
)
?
$emitme_max_r
:
NULL
;
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
element_mix
(
$e_mixlist
,
$emr
,
$er
);
}
else
{
$log
.=
"至少要放入一份元素。<br>"
;}
}
else
{
$log
.=
"你挠了挠头,没搞懂自己到底要干什么。<br>"
;}
$mode
=
'command'
;
}
elseif
(
$command
==
'elementbag'
)
{
if
(
$club
==
20
){
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
print_elements_info
();
}
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
$itmemax
=
$change_emax
?
(
int
)
$emixitmemax
:
100
;
$itmer
=
$change_emr
?
(
int
)
$emixitmer
:
55
;
elements_mix_prepare
(
$emixlist
,
$emixnums
,
$itmemax
,
$itmer
);
$mode
=
'command'
;
}
elseif
(
$command
==
'itemencase'
)
{
if
(
strpos
(
$arbsk
,
'^'
)
!==
false
&&
$arbs
&&
$arbe
){
...
...
gamedata/cache/clubskills_1.php
View file @
6bded008
...
...
@@ -119,6 +119,7 @@ $cskills = Array
'effect'
=>
Array
(
0
=>
Array
(
'hp'
=>
'+=::3'
,
'mhp'
=>
'+=::3'
,),
12
=>
Array
(
'hp'
=>
'+=::6'
,
'mhp'
=>
'+=::6'
,),
20
=>
Array
(
'hp'
=>
'+=::4'
,
'mhp'
=>
'+=::4'
,),
),
),
's_ad'
=>
Array
...
...
gamedata/cache/elementmix_1.php
View file @
6bded008
...
...
@@ -4,16 +4,6 @@
/********元素大师配置文件********/
//wei shenme hui zheyang ne....
global
$no_type_to_e_list
,
$no_itm_to_e_list
,
$no_itmk_to_e_list
,
$no_itmsk_to_e_list
,
$no_emix_circulation
;
global
$split_itm_fix
,
$split_spitm_fix
,
$split_spcorpse_fix
;
global
$split_corpse_lvl_r
,
$split_default_itmk_r
,
$split_itmk_r
,
$split_default_itmsk_fix
,
$split_itmsk_fix
;
global
$temp_etags
;
global
$max_emix_itme_start
,
$max_emix_itme_up
;
global
$emix_list
,
$random_emix_list
,
$dommix_list
,
$submix_list
,
$random_submix_list
,
$itmk_to_itmsk_tags
;
global
$emix_luck_info
,
$emix_tips_arr
,
$emix_name_brackets_arr
,
$emix_name_prefix_arr
,
$emix_name_meta_arr
,
$emix_name_tail_arr
;
global
$emix_slip
;
//过滤选项:
//不可以被拆解的NPC类型
$no_type_to_e_list
=
Array
();
...
...
@@ -184,31 +174,71 @@
(
//dom => 主要特征(类别) sub => 次要特征(属性)
//max_d(s)_tags => 仅在研究模式开启的情况下生效,用于限定元素随机生成的标签上限
0
=>
Array
(
'dom'
=>
Array
(
'WD'
,
'DF'
),
'sub'
=>
Array
(
'd'
,
'D'
,
'
R
'
,
'z'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//亮晶晶
0
=>
Array
(
'dom'
=>
Array
(
'WD'
,
'DF'
),
'sub'
=>
Array
(
'd'
,
'D'
,
'
H
'
,
'z'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//亮晶晶
1
=>
Array
(
'dom'
=>
Array
(
'WG'
,
'DA'
),
'sub'
=>
Array
(
'u'
,
'G'
,
'U'
,
'c'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//暖洋洋
2
=>
Array
(
'dom'
=>
Array
(
'WC'
,
'DH'
),
'sub'
=>
Array
(
'i'
,
'C'
,
'I'
,
'M'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//冷冰冰
3
=>
Array
(
'dom'
=>
Array
(
'WK'
,
'HS'
),
'sub'
=>
Array
(
'p'
,
'K'
,
'q'
,
'H'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//郁萌萌
4
=>
Array
(
'dom'
=>
Array
(
'WP'
,
'HH'
),
'sub'
=>
Array
(
'e'
,
'P'
,
'E'
,
'x'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//昼闪闪
5
=>
Array
(
'dom'
=>
Array
(
'WF'
,
'DB'
),
'sub'
=>
Array
(
'w'
,
'F'
,
'W'
,
'S'
),
'max_d_tags'
=>
2
,
'max_s_tags'
=>
4
,),
//夜静静
);
$flip_d_tag
=
Array
(
'WD'
=>
0
,
'DF'
=>
0
,
'WG'
=>
1
,
'DA'
=>
1
,
'WC'
=>
2
,
'DH'
=>
2
,
'WK'
=>
3
,
'HS'
=>
3
,
'WP'
=>
4
,
'HH'
=>
4
,
'WF'
=>
5
,
'DB'
=>
5
,
);
$flip_s_tag
=
Array
(
'd'
=>
0
,
'D'
=>
0
,
'R'
=>
0
,
'z'
=>
0
,
'u'
=>
1
,
'G'
=>
1
,
'U'
=>
1
,
'c'
=>
1
,
'i'
=>
2
,
'C'
=>
2
,
'I'
=>
2
,
'M'
=>
2
,
'p'
=>
3
,
'K'
=>
3
,
'q'
=>
3
,
'H'
=>
3
,
'e'
=>
4
,
'P'
=>
4
,
'E'
=>
4
,
'x'
=>
4
,
'w'
=>
5
,
'F'
=>
5
,
'W'
=>
5
,
'S'
=>
5
,
);
//合成出的道具效果上限值(0级时):
$max_emix_itme_start
=
45
;
//每等级能够提升的道具效果上限(具体计算方法在get_emix_itme_max()内)
$max_emix_itme_up
=
29
;
//固定合成配方:投入固定数量元素 输出指定结果
$emix_list
=
Array
# 固定结果配方:按照指定顺序投入arr[1]份arr[0]元素
$emix_
fix
list
=
Array
(
//子弹杯里伏特加加冰 兑小可可乐
Array
(
'stuff'
=>
Array
(
1
=>
58
,
5
=>
18
),
'result'
=>
Array
(
'大卫·马丁内斯'
,
'HB'
,
58
,
18
,
'p'
),),
//移动PC:亮晶晶20、昼闪闪20
Array
(
'stuff'
=>
Array
(
0
=>
20
,
4
=>
20
),
'result'
=>
Array
(
'移动PC'
,
'EE'
,
5
,
1
,
'z'
),),
//UG:投入全种类元素各1份
Array
(
'stuff'
=>
Array
(
0
=>
1
,
1
=>
1
,
2
=>
1
,
3
=>
1
,
4
=>
1
,
5
=>
1
,),
'result'
=>
Array
(
'Untainted Glory'
,
'A'
,
1
,
1
,
'Z'
),),
//仪水镜:投入全种类元素各7份
Array
(
'stuff'
=>
Array
(
0
=>
7
,
1
=>
7
,
2
=>
7
,
3
=>
7
,
4
=>
7
,
5
=>
7
,),
'result'
=>
Array
(
'仪水镜'
,
'Y'
,
1
,
1
,),),
# 移动PC:亮晶晶20、昼闪闪20
Array
(
'stuff'
=>
Array
(
0
=>
Array
(
0
,
20
),
1
=>
Array
(
4
,
20
)),
'result'
=>
Array
(
'移动PC'
,
'EE'
,
5
,
1
,
'z'
),),
# UG:投入全种类元素各1份
Array
(
'stuff'
=>
Array
(
0
=>
Array
(
0
,
1
),
1
=>
Array
(
1
,
1
),
2
=>
Array
(
2
,
1
),
3
=>
Array
(
3
,
1
),
4
=>
Array
(
4
,
1
),
5
=>
Array
(
5
,
1
)),
'result'
=>
Array
(
'Untainted Glory'
,
'A'
,
1
,
1
,
'Z'
),),
# 仪水镜:投入全种类元素各7份
Array
(
'stuff'
=>
Array
(
0
=>
Array
(
0
,
7
),
1
=>
Array
(
1
,
7
),
2
=>
Array
(
2
,
7
),
3
=>
Array
(
3
,
7
),
4
=>
Array
(
4
,
7
),
5
=>
Array
(
5
,
7
)),
'result'
=>
Array
(
'仪水镜'
,
'Y'
,
1
,
1
,
''
),),
);
//随机的固定合成配方(?):需要的素材随机 输出的结果固定 //随机指的是在每局生成临时配置文件时决定 不是完全随机
$rand
om_emix_
list
=
Array
# 素材随机的固定结果配方
$rand
_emix_fix
list
=
Array
(
//'stuff'=> 键名=>随机元素在数组中的自然排序的位置 键值=> 'r_x-y' 的格式等同于 rand(x,y)
//'class'=>'hidden' 不会被提示纸条揭露的配方
...
...
@@ -230,33 +260,35 @@
//obbs:满足条件时有obbs%的概率组合,不设置即为100%组合;random:开启研究模式的情况下,随机为此配方生成random个合成条件。
$dommix_list
=
array
(
Array
(
'stuff'
=>
Array
(
'WG'
,
'WG'
,
'WG'
,
'WC'
,
'WD'
),
'result'
=>
'WJ'
,
'obbs'
=>
15
,),
//3射+1投+1爆=重枪(15%概率)
Array
(
'stuff'
=>
Array
(
'WG'
,
'WK'
),
'result'
=>
'WGK'
,
'obbs'
=>
77
,),
//射+斩=枪刃
Array
(
'stuff'
=>
Array
(
'WC'
,
'WF'
),
'result'
=>
'WCF'
,
'obbs'
=>
77
,),
//投+符=符札
Array
(
'stuff'
=>
Array
(
'WC'
,
'WP'
),
'result'
=>
'WCP'
,
'obbs'
=>
77
,),
//投+殴=重物
Array
(
'stuff'
=>
Array
(
'WF'
,
'WK'
),
'result'
=>
'WFK'
,
'obbs'
=>
77
,),
//符+斩=魔刃……?
Array
(
'stuff'
=>
Array
(
'WK'
,
'WF'
),
'result'
=>
'WKF'
,
'obbs'
=>
77
,),
//斩+符=灵刃
Array
(
'stuff'
=>
Array
(
'WK'
,
'WP'
),
'result'
=>
'WKP'
,
'obbs'
=>
77
,),
//斩+殴=重剑
Array
(
'stuff'
=>
Array
(
'WF'
,
'WK'
,
'DA'
),
'result'
=>
'WFK'
,
'obbs'
=>
77
,),
//符+斩=魔刃……?等等……?只能再加个DA凑数了
Array
(
'stuff'
=>
Array
(
'WD'
,
'WG'
),
'result'
=>
'WDG'
,
'obbs'
=>
77
,),
//爆+射=巨炮
Array
(
'stuff'
=>
Array
(
'WD'
,
'WF'
),
'result'
=>
'WDF'
,
'obbs'
=>
77
,),
//爆+符=落魂
Array
(
'stuff'
=>
Array
(
'WD'
,
'DF'
,
'WD'
),
'result'
=>
'VD'
),
Array
(
'stuff'
=>
Array
(
'WG'
,
'DA'
,
'WG'
),
'result'
=>
'VG'
),
Array
(
'stuff'
=>
Array
(
'WC'
,
'DH'
,
'WC'
),
'result'
=>
'VC'
),
Array
(
'stuff'
=>
Array
(
'WK'
,
'HS'
,
'WK'
),
'result'
=>
'VK'
),
Array
(
'stuff'
=>
Array
(
'WP'
,
'HH'
,
'WP'
),
'result'
=>
'VP'
),
Array
(
'stuff'
=>
Array
(
'WF'
,
'DB'
,
'WF'
),
'result'
=>
'VF'
),
Array
(
'stuff'
=>
Array
(
'HH'
,
'HS'
),
'result'
=>
'HB'
,
'obbs'
=>
77
,),
//回命+回体=命体回复
Array
(
'stuff'
=>
Array
(
'HH'
,
'WF'
),
'result'
=>
'HM'
,
'obbs'
=>
77
,),
//回命+灵=歌魂增加
Array
(
'stuff'
=>
Array
(
'HS'
,
'WD'
),
'result'
=>
'HT'
,
'obbs'
=>
77
,),
//回体+爆=歌魂恢复
Array
(
'stuff'
=>
Array
(
'HH'
,
'WG'
),
'result'
=>
'MH'
,
'obbs'
=>
15
,),
//回命+射=生命强化
Array
(
'stuff'
=>
Array
(
'HS'
,
'WC'
),
'result'
=>
'MS'
,
'obbs'
=>
60
,),
//回体+投=体力强化
Array
(
'stuff'
=>
Array
(
'WG'
,
'WG'
),
'result'
=>
'WJ'
,
'obbs'
=>
30
,),
//射+射=重枪(30%概率)
//我认为这里应该有一个配方 可以合出有毒补给或者地雷(
);
//
次要特征组合配方:将次要特征转化为道具属性时,检查是否满足组合条件。两个配方存在重复元素时,排在前面的会优先生成。
#
次要特征组合配方:将次要特征转化为道具属性时,检查是否满足组合条件。两个配方存在重复元素时,排在前面的会优先生成。
$submix_list
=
array
(
Array
(
'stuff'
=>
Array
(
'x'
,
'z'
),
'result'
=>
'Z'
,
'obbs'
=>
13
),
//奇迹+天然=菁英
//Array('stuff'=>Array('u','i'),'result'=>'d','obbs'=>Array('default'=>30,'WD'=>98,'WDG'=>75,'WDF'=>75),), //火+冻=爆炸
//Array('stuff'=>Array('i','e'),'result'=>'d','obbs'=>Array('default'=>30,'WD'=>98,'WDG'=>75,'WDF'=>75),), //冻+电=爆炸
//Array('stuff'=>Array('w','i'),'result'=>'d','obbs'=>Array('default'=>30,'WD'=>98,'WDG'=>75,'WDF'=>75),), //音+冻=爆炸
//冴冴来发挥奇思妙想吧
Array
(
'stuff'
=>
Array
(
'u'
,
'x'
,
'z'
),
'result'
=>
'f'
,
'obbs'
=>
33
),
Array
(
'stuff'
=>
Array
(
'i'
,
'x'
,
'z'
),
'result'
=>
'k'
,
'obbs'
=>
33
),
);
//随机的次要特征组合配方 注意:指定属性(sk_*)一定要放到最前面
//可能会生成重复配方,但是也无所谓~
# 随机的次要特征组合配方 注意:指定属性(sk_*)一定要放到最前面
$random_submix_list
=
Array
(
//连击:随机1个价值在20以上,1个价值在30以上的次要特征
...
...
@@ -264,12 +296,16 @@
//冲击:随机1个价值在20以上特征+1个随机“攻击”标签特征
Array
(
'stuff'
=>
Array
(
0
=>
'tags_W'
,
1
=>
'v_20'
),
'result'
=>
'N'
,
'obbs'
=>
50
),
//贯穿:重击辅助+随机2个价值在30以上的次要特征
Array
(
'stuff'
=>
Array
(
0
=>
'sk_c'
,
1
=>
'v_30'
,
2
=>
'v_30'
),
'result'
=>
'n'
,
'obbs'
=>
66
),
Array
(
'stuff'
=>
Array
(
0
=>
'c'
,
1
=>
'v_30'
,
2
=>
'v_30'
),
'result'
=>
'n'
,
'obbs'
=>
66
),
//破格:陷阱探测+随机2个价值在30以上的次要特征
Array
(
'stuff'
=>
Array
(
0
=>
'M'
,
1
=>
'v_30'
,
2
=>
'v_30'
),
'result'
=>
'n'
,
'obbs'
=>
66
),
//属性防御:随机1个价值在30以上+2个随机“防御”标签特征
Array
(
'stuff'
=>
Array
(
0
=>
'v_30'
,
1
=>
'tags_D'
,
2
=>
'tags_D'
),
'result'
=>
'a'
,
'obbs'
=>
50
),
//全系防御:随机2个价值在30以上的次要特征+1个随机“防御”标签特征
Array
(
'stuff'
=>
Array
(
0
=>
'v_30'
,
1
=>
'v_30'
,
2
=>
'tags_D'
),
'result'
=>
'A'
,
'obbs'
=>
50
),
);
# 可重复生成的次要特征
$repeat_subtags
=
Array
(
'u'
,
'i'
,
'e'
,
'w'
,
'p'
);
//合成结果-名字:
$emix_luck_info
=
Array
(
-
2
=>
'自己要倒大霉了QAQ……'
,
1
=>
'这次合成的结果应该没什么特别之处。'
,
2
=>
'这次合成的结果还算不错。'
,
3
=>
'这次合成的结果似乎相当不错!'
,
4
=>
'有什么大好事要发生了!'
);
...
...
gamedata/cache/resources_1.php
View file @
6bded008
...
...
@@ -1340,6 +1340,15 @@ $elements_info = Array
4
=>
$sparkle
.
'<span class="mtgwhite">昼闪闪</span>'
.
$sparkle
,
5
=>
$sparkle
.
'<span class="mtgblack">夜静静</span>'
.
$sparkle
,
);
$r_elements_info
=
Array
(
0
=>
'<span class="mtgcolorless">亮晶晶</span>'
,
1
=>
'<span class="mtgred">暖洋洋</span>'
,
2
=>
'<span class="mtgblue">冷冰冰</span>'
,
3
=>
'<span class="mtggreen">郁萌萌</span>'
,
4
=>
'<span class="mtgwhite">昼闪闪</span>'
,
5
=>
'<span class="mtgblack">夜静静</span>'
,
);
//NPC在躲避禁区、追杀玩家时不会进入的危险区(默认:无月之影、SCP、雏菊、英灵殿)
$deepzones
=
Array
(
0
,
32
,
33
,
34
);
//安全箱位置
...
...
include/game/achievement.func.php
View file @
6bded008
...
...
@@ -734,14 +734,14 @@ function check_mixitem_achievement_rev($nn,$item)
//新版结局成就检测机制:加入团队胜利兼容
//function check_end_achievement_rev($w,$m)
function
check_end_achievement_rev
(
$w
,
$m
,
$data
=
''
)
function
check_end_achievement_rev
(
$w
,
$m
,
$data
=
NULL
)
{
global
$now
,
$validtime
,
$starttime
,
$gamecfg
,
$name
,
$db
,
$tablepre
;
include_once
GAME_ROOT
.
'./include/game/titles.func.php'
;
$done
=
0
;
$atotal
=
Array
();
$data
[
'clbpara'
]
=
get_clbpara
(
$data
[
'clbpara'
]);
if
(
!
empty
(
$data
[
'clbpara'
])
&&
!
is_array
(
$data
[
'clbpara'
]))
$data
[
'clbpara'
]
=
get_clbpara
(
$data
[
'clbpara'
]);
//16. 最后幸存成就
if
(
$m
==
2
)
...
...
include/game/elementmix.calc.php
0 → 100644
View file @
6bded008
<?php
if
(
!
defined
(
'IN_GAME'
))
{
exit
(
'Access Denied'
);
}
# 过滤不能拆解的道具(数组) 不能分解返回1 能分解返回0
function
split_to_elements_filter
(
$i
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
$i
)
{
//过滤不能分解的道具种类
if
((
!
is_array
(
$i
[
'itmk'
])
&&
in_array
(
$i
[
'itmk'
],
$no_itmk_to_e_list
))
||
(
is_array
(
$i
[
'itmk'
])
&&
array_intersect
(
$i
[
'itmk'
],
$no_itmsk_to_e_list
)))
return
1
;
//过滤不能分解的道具名
foreach
(
$no_itm_to_e_list
as
$no_itm
)
{
if
(
preg_match
(
"/
$no_itm
/"
,
$i
[
'itm'
]))
return
1
;
}
//过滤不能分解的道具属性
if
(
$i
[
'itmsk'
])
{
//把道具属性打散成数组
$tmp_itmsk_arr
=
get_itmsk_array
(
$i
[
'itmsk'
]);
if
(
array_intersect
(
$tmp_itmsk_arr
,
$no_itmsk_to_e_list
))
return
1
;
}
return
0
;
}
return
1
;
}
# 分解会触发事件的尸体/道具
function
esplit_vip_things
(
$ev_arr
,
$edata
,
&
$data
,
$spt
=
'corpse'
)
{
global
$log
,
$elements_info
,
$gamecfg
,
$gamevars
,
$typeinfo
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
empty
(
$ev_arr
))
$ev_arr
=
Array
(
0
=>
0
,
1
=>
0
,
2
=>
0
,
3
=>
0
,
4
=>
0
,
5
=>
0
);
# 如果随机配方尚未生成,先生成随机配方
if
(
empty
(
$gamevars
[
'rand_emixfixres'
]))
$gamevars
[
'rand_emixfixres'
]
=
esp_spawn_rand_emixfixres
();
# 读取配方
if
(
$spt
==
'corpse'
)
{
$e_list
=
$split_spcorpse_fix
[
$edata
[
'type'
]];
if
(
is_array
(
$e_list
))
$e_list
=
$e_list
[
$edata
[
'name'
]];
}
else
{
$e_list
=
$split_itm_fix
[
$edata
[
'itm'
]];
}
# 解码配方
$e_list
=
explode
(
'-'
,
str_replace
(
'r_'
,
''
,
$e_list
));
# 获得配方编号与素材编号
$erkey
=
$e_list
[
0
];
$eskey
=
$e_list
[
1
];
# 解码后能获得的是随机某条素材
if
(
$eskey
==
'r'
)
$eskey
=
array_rand
(
$gamevars
[
'rand_emixfixres'
][
$erkey
][
'stuff'
]);
$earr
=
$gamevars
[
'rand_emixfixres'
][
$erkey
][
'stuff'
][
$eskey
];
# 记录以下配方信息:素材位置、素材所需元素编号、素材所需元素数量
$esid
=
$earr
[
0
];
$esnum
=
$earr
[
1
];
if
(
$spt
==
'corpse'
)
{
$log
.=
"<span class='grey'>你发现从
{
$typeinfo
[
$edata
[
'type'
]]
}
身上飘落的<span class='red'>
{
$esnum
}
</span>份
{
$elements_info
[
$esid
]
}
样子有点奇怪……怎么回事呢?</span><br>"
;
}
else
{
$log
.=
"<span class='grey'>你发现构成
{
$edata
[
'itm'
]
}
的<span class='red'>
{
$esnum
}
</span>份
{
$elements_info
[
$esid
]
}
样子有点奇怪……怎么回事呢?</span><br>"
;
}
if
(
empty
(
$clbpara
[
'elements'
][
'info'
][
'hd'
][
'h'
.
$erkey
][
's'
.
$eskey
]))
{
$clbpara
[
'elements'
][
'info'
][
'hd'
][
'h'
.
$erkey
][
's'
.
$eskey
]
=
1
;
}
$ev_arr
[
$esid
]
+=
$esnum
;
return
$ev_arr
;
}
# 通过输入的道具/装备数组计算对应的元素价值
# 输入的iarr默认的格式:$iarr=Array('arb或itm0'=>Array('itm'=>$arb或$itm0,'itmk'=>$arbk或$itmk0.....),)
function
esplit_get_values_by_iarr
(
$iarr
,
$ev_arr
,
&
$data
)
{
global
$log
,
$mode
,
$typeinfo
,
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
empty
(
$ev_arr
))
$ev_arr
=
Array
(
0
=>
0
,
1
=>
0
,
2
=>
0
,
3
=>
0
,
4
=>
0
,
5
=>
0
);
# 开始计算元素价值
foreach
(
$iarr
as
$i
=>
$t
)
{
# 最优先:检查拆解特定道具(全名匹配)时的事件
if
(
isset
(
$split_itm_fix
[
$t
[
'itm'
]]))
{
# 处理秘钥道具
if
(
!
is_array
(
$split_itm_fix
[
$t
[
'itm'
]])
&&
strpos
(
$split_itm_fix
[
$t
[
'itm'
]],
'r_'
)
===
0
)
{
esplit_vip_things
(
$ev_arr
,
$t
,
$data
,
'itm'
);
continue
;
}
# 处理吐出来的道具,一次分解最多只会吐一个道具,后到先得。
elseif
(
!
empty
(
$split_itm_fix
[
$t
[
'itm'
]][
'spitm'
]))
{
if
(
isset
(
$ev_arr
[
'spitm'
]))
unset
(
$ev_arr
[
'spitm'
]);
$ev_arr
[
'spitm'
]
=
$split_itm_fix
[
$t
[
'itm'
]][
'spitm'
];
continue
;
}
else
{
foreach
(
$split_itm_fix
[
$t
[
'itm'
]]
as
$ekey
=>
$ev
)
$ev_arr
[
$ekey
]
+=
$ev
;
}
continue
;
}
# 次优先:检查拆解关键词匹配道具名时的事件(改为手动添加判断条件)
if
(
strpos
(
$t
[
'itm'
],
'方块'
)
!==
false
||
strpos
(
$t
[
'itm'
],
'宝石方块'
)
!==
false
)
{
$ev
=
strpos
(
$t
[
'itm'
],
'方块'
)
!==
false
?
400
:
1000
;
$ekey
=
rand
(
0
,
5
);
$ev_arr
[
$ekey
]
+=
$ev
;
continue
;
}
# 跳过不能分解的道具
if
(
split_to_elements_filter
(
$t
))
continue
;
# 根据道具类别确定分解道具可获得的元素
$ekey
=
isset
(
$flip_d_tag
[
$t
[
'itmk'
]])
?
$flip_d_tag
[
$t
[
'itmk'
]]
:
array_rand
(
$elements_info
);
# 计算分解道具能获得元素数量
$ev
=
esplit_calc_itm_value
(
$t
[
'itmk'
],
$t
[
'itme'
],
$t
[
'itms'
],
$data
);
# 应用
$ev_arr
[
$ekey
]
+=
$ev
;
# 根据道具属性计算道具的附加价值
if
(
!
empty
(
$t
[
'itmsk'
]))
{
$t
[
'itmsk'
]
=
get_itmsk_array
(
$t
[
'itmsk'
]);
foreach
(
$t
[
'itmsk'
]
as
$tsk
)
{
//获取单个属性关联的元素 没有则随机挑选一个元素
$ekey
=
isset
(
$flip_s_tag
[
$tsk
])
?
$flip_s_tag
[
$tsk
]
:
array_rand
(
$elements_info
);
if
(
isset
(
$ekey
))
{
$ev
=
emix_calc_subtag_value
(
$tsk
,
$t
[
'itme'
],
$t
[
'itmk'
],
$data
);
$ev_arr
[
$ekey
]
+=
$ev
;
}
}
}
}
return
$ev_arr
;
}
# 通过道具的类别(主要特征)计算价值
function
esplit_calc_itm_value
(
$dom
,
$itme
,
$itms
,
&
$data
)
{
global
$log
,
$elements_info
,
$gamecfg
,
$nosta
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
# 获取道具类别对应系数
if
(
isset
(
$split_itmk_r
[
$dom
]))
{
$evr
=
$split_itmk_r
[
$dom
];
}
else
{
$dom
=
filter_itemkind
(
$dom
);
$evr
=
isset
(
$split_itmk_r
[
$dom
])
?
$split_itmk_r
[
$dom
]
:
$split_default_itmk_r
;
}
# 无限耐久的道具没有耐久价值
if
(
$itms
==
$nosta
)
$itms
=
0
;
# 道具价值 = 道具类别系数 × (道具效果+道具耐久) / 2
$ev
=
$evr
*
((
$itme
+
$itms
)
/
2
);
return
$ev
;
}
# 计算元素次要特征的价值
function
emix_calc_subtag_value
(
$sub
,
$itme
,
$itmk
=
'default'
,
&
$data
)
{
global
$log
,
$elements_info
,
$gamecfg
;
global
$ex_base_dmg
,
$ex_wep_dmg
,
$ex_max_dmg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
# 检查是有价值属性还是默认价值属性
$sub_value
=
isset
(
$split_itmsk_fix
[
$sub
])
?
$split_itmsk_fix
[
$sub
]
:
$split_default_itmsk_fix
;
# 属性价值是数组的情况下,检查能否根据道具类别判定价值
if
(
is_array
(
$sub_value
))
{
$sub_value
=
isset
(
$sub_value
[
$itmk
])
?
$sub_value
[
$itmk
]
:
$sub_value
[
'default'
];
}
# 属性是攻击类属性(烧冻毒麻乱)、传入的道具类别是武器,且传入的武器效果不为0时,根据武器效果判定属性价值
if
(
array_key_exists
(
$sub
,
$ex_wep_dmg
)
&&
strpos
(
$itmk
,
'W'
)
===
0
&&
!
empty
(
$itme
))
{
# 计算属性能造成的伤害
$ex_dmg
=
$ex_base_dmg
[
$sub
]
+
$itme
/
$ex_wep_dmg
[
$sub
];
$ex_dmg
=
$ex_max_dmg
[
$sub
]
==
0
?
$ex_dmg
:
min
(
$ex_dmg
,
$ex_max_dmg
[
$sub
]);
# 根据能造成的属性伤害,计算属性价值
$sub_value
=
max
(
$ex_dmg
,
$sub_value
);
# 爆炸物特殊修正:仅计算1/3属性
if
(
$sub
==
'd'
&&
strpos
(
$itmk
,
'D'
)
!==
false
)
$sub_value
=
round
(
$sub_value
*
0.33
);
}
return
$sub_value
;
}
# 判断合成是否存在固定结果
function
emix_check_fix_result
(
$emlist
,
$emnums
,
&
$data
)
{
global
$now
,
$log
,
$gamecfg
,
$gamevars
,
$elements_info
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$fix_flag
=
0
;
# 检查固定配方
foreach
(
$emix_fixlist
as
$ffkey
=>
$femix
)
{
if
(
count
(
$femix
[
'stuff'
])
==
count
(
$emlist
))
{
foreach
(
$femix
[
'stuff'
]
as
$fkey
=>
$farr
)
{
if
(
$farr
[
0
]
==
$emlist
[
$fkey
]
&&
$farr
[
1
]
==
$emnums
[
$fkey
])
{
$fix_flag
=
$femix
[
'result'
];
# 将成功合成的条目保存在笔记内
if
(
empty
(
$clbpara
[
'elements'
][
'info'
][
'd'
][
'd'
.
$ffkey
]))
$clbpara
[
'elements'
][
'info'
][
'd'
][
'd'
.
$ffkey
]
=
1
;
break
;
}
}
}
}
# 如果随机配方尚未生成,先生成随机配方
if
(
empty
(
$gamevars
[
'rand_emixfixres'
]))
$gamevars
[
'rand_emixfixres'
]
=
esp_spawn_rand_emixfixres
();
# 检查随机配方
foreach
(
$gamevars
[
'rand_emixfixres'
]
as
$fkkey
=>
$femix
)
{
if
(
count
(
$femix
[
'stuff'
])
==
count
(
$emlist
))
{
foreach
(
$femix
[
'stuff'
]
as
$fkey
=>
$farr
)
{
if
(
$farr
[
0
]
==
$emlist
[
$fkey
]
&&
$farr
[
1
]
==
$emnums
[
$fkey
])
{
$fix_flag
=
$rand_emix_fixlist
[
$fkkey
][
'result'
];
break
;
}
}
}
}
# 获取固定合成结果
if
(
!
empty
(
$fix_flag
))
{
$log
.=
"<br>但是出现结果的速度比你想象中要快得多!<br>你还没反应过来,元素们就把一样东西吐了出来!<br><br>"
;
$itm0
=
$fix_flag
[
0
];
$itmk0
=
$fix_flag
[
1
];
$itmsk0
=
$fix_flag
[
4
];
$itme0
=
$fix_flag
[
2
];
$itms0
=
$fix_flag
[
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
addnews
(
$now
,
'emix_success'
,
$name
,
$fix_flag
[
0
]);
return
1
;
}
return
$fix_flag
;
}
# 判断合成运势
function
emix_check_mix_luck
(
$downfix
=
0
,
$upfix
=
0
)
{
# 掷骰:
$emix_dice
=
rand
(
1
,
100
)
+
$upfix
-
$downfix
;
switch
(
$emix_dice
)
{
case
$emix_dice
<=
5
:
//大成功
$emix_flag
=
4
;
break
;
case
$emix_dice
<=
15
:
//出色表现
$emix_flag
=
3
;
break
;
case
$emix_dice
<=
50
:
//成功
$emix_flag
=
2
;
break
;
case
$emix_dice
<=
96
:
//普通
$emix_flag
=
1
;
break
;
default
:
//哇 这下便样衰了!(道具会带有灵魂绑定属性 可恶 为什么诅咒属性不见了)
$emix_flag
=
-
2
;
}
return
$emix_flag
;
}
# 检查参与合成的元素主特征
function
emix_get_domtags
(
$emlist
,
$emnums
,
$domkey
,
&
$data
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
$tags
=
Array
();
# 获取主元素的主特征
foreach
(
$domkey
as
$key
)
{
$tag
=
$temp_etags
[
$emlist
[
$key
]][
'dom'
];
# 投入单数份元素,返回第0个主特征;否则返回第1个主特征
if
(
is_array
(
$tag
))
{
$f
=
fmod
(
$emnums
[
$key
],
2
);
$f
=
$f
?
0
:
1
;
$tag
=
$tag
[
$f
];
}
# 将探索到的主特征加入笔记内
if
(
empty
(
$data
[
'clbpara'
][
'elements'
][
'tags'
][
$emlist
[
$key
]][
'dom'
][
$f
]))
$data
[
'clbpara'
][
'elements'
][
'tags'
][
$emlist
[
$key
]][
'dom'
][
$f
]
=
1
;
$tags
[]
=
$tag
;
}
return
$tags
;
}
# 根据主特征生成道具类别
function
emix_spawn_itmk
(
$dom_tags
,
$emix_flag
=
NULL
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
$emix_itmk
=
''
;
$obbs_fix
=
0
;
//根据合成表现修正概率
if
(
$emix_flag
)
{
$obbs_fix
=
$emix_flag
*
10
;
}
if
(
count
(
$dom_tags
)
>
1
)
{
//存在复数个主特征,判断能否进行组合
$mixflag
=
false
;
foreach
(
$dommix_list
as
$mkey
=>
$minfo
)
{
//直接抄合成匹配逻辑了 有一种野性的美
if
(
!
array_diff
(
$dom_tags
,
$minfo
[
'stuff'
])
&&
!
array_diff
(
$minfo
[
'stuff'
],
$dom_tags
)
&&
count
(
$dom_tags
)
==
count
(
$minfo
[
'stuff'
]))
{
//if($minfo['obbs'] && (diceroll(100)-$obbs_fix)>$minfo['obbs']) continue;
if
(
$minfo
[
'obbs'
]
&&
(
rand
(
0
,
100
)
-
$obbs_fix
)
>
$minfo
[
'obbs'
])
continue
;
//配方为概率合成 掷骰判定没通过 跳过
$emix_itmk
=
$minfo
[
'result'
];
$mixflag
=
true
;
# 将成功合成的条目保存在笔记内
if
(
empty
(
$clbpara
[
'elements'
][
'info'
][
'dd'
][
'dd'
.
$mkey
]))
$clbpara
[
'elements'
][
'info'
][
'dd'
][
'dd'
.
$mkey
]
=
1
;
break
;
}
}
//没有匹配的组合 随机返回一个主特征作为类别
if
(
!
$mixflag
)
$emix_itmk
=
$dom_tags
[
array_rand
(
$dom_tags
)];
}
else
{
//只有一个主特征 直接让它作为类别返回
$emix_itmk
=
$dom_tags
[
0
];
}
return
$emix_itmk
;
}
function
emix_calc_maxenum
(
&
$data
=
NULL
)
{
global
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$max_enum
=
$lvl
<
31
?
ceil
(
$max_emix_itme_start
+
(
$max_emix_itme_up
*
$lvl
*
((
255
-
$lvl
)
/
255
)))
:
ceil
(
$max_emix_itme_start
+
((
$max_emix_itme_up
+
$lvl
)
*
$lvl
));
return
$max_enum
;
}
# 生成道具数量、耐久
function
emix_spawn_itmes
(
&
$emlist
,
&
$emnums
,
$domkey
,
$eitmemax
,
$eitmesr
,
&
$total_enum
,
$emix_itmk
,
&
$data
,
$emix_flag
=
NULL
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
# 计算当前所能合成出的道具效耐最大值
# 理论上限值:(前32级时的计算公式:基础+提升值*等级*(255-等级)%)(32级后:基础+(提升值+等级)*等级))
$max_enum
=
emix_calc_maxenum
(
$data
);
# 通过自定义上限系数对理论上限进行修正
$max_enum
=
ceil
(
$max_enum
*
$eitmemax
/
100
);
# 计算投入数量是否超过理论上限
$max_enum
=
min
(
$max_enum
,
$total_enum
);
# 理论上限小于2时,合成失败
if
(
$max_enum
<
2
)
return
0
;
# 根据投入比例,依次扣除参与合成的元素数量
foreach
(
$emnums
as
$ekey
=>
$enum
)
{
# 计算每个元素实际的消耗
$tmp_cost
=
round
(
$max_enum
*
(
$enum
/
$total_enum
));
$emnums
[
$ekey
]
-=
$tmp_cost
;
}
# 从总投入量中扣除构成主体消耗掉的部分
$total_enum
-=
$max_enum
;
# 为道具分配效果、耐久比例;
# 非大成功、且自定义比例超过80%或低于20%时,有概率合成失败
if
(
$emix_flag
!=
4
&&
(
$eitmesr
>=
80
||
$eitmesr
<=
20
))
{
$dice
=
rand
(
0
,
99
);
$obbs
=
$eitmesr
>=
80
?
21
-
(
100
-
$eitmesr
)
:
21
-
$eitmesr
;
if
(
$dice
<
$obbs
)
return
0
;
}
$itmer
=
$eitmesr
;
$itmsr
=
100
-
$eitmesr
;
# 为道具分配效果、耐久
$eitme
=
$emix_flag
==
4
?
$max_enum
:
ceil
(
$max_enum
*
$itmer
/
100
*
(
$emix_flag
/
10
+
1
));
$eitms
=
$emix_flag
==
4
?
'∞'
:
ceil
(
$max_enum
*
$itmsr
/
100
*
(
$emix_flag
/
10
+
1
));
# 根据道具类别,修正道具效果、耐久
# 防具耐久调整
if
(
strpos
(
$emix_itmk
,
'D'
)
===
0
)
{
# 大失败时防具耐久变成∞
if
(
$emix_flag
==
-
2
)
{
$eitms
=
'∞'
;
}
# 大成功时防具耐久等于防具效果
if
(
$emix_flag
==
4
)
{
$eitms
=
$eitme
;
}
}
# 强化药物、技能书籍效耐调整:效果最大不能超过角色等级、耐久最大不超过角色等级的平方根,且向下调整
if
(
strpos
(
$emix_itmk
,
'M'
)
===
0
||
strpos
(
$emix_itmk
,
'HM'
)
===
0
||
strpos
(
$emix_itmk
,
'V'
)
===
0
)
{
$eitme
=
min
(
$lvl
,
floor
(
$eitme
/
$lvl
));
$eitms
=
min
(
ceil
(
sqrt
(
$lvl
)),
floor
(
$eitms
/
$lvl
));
}
if
(
!
$eitme
||
!
$eitms
)
return
0
;
return
Array
(
$eitme
,
$eitms
);
}
# 获取元素可展现的次要特征
function
emix_get_subtags
(
$emlist
,
$emnums
,
$emix_itme
,
$emix_itmk
,
&
$data
,
$emix_flag
=
NULL
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$subtags
=
Array
();
# 遍历元素队列,获取可生成的次要特征
foreach
(
$emlist
as
$ekey
=>
$eid
)
{
if
(
$emnums
[
$ekey
]
>
0
)
{
$esubkey
=
$temp_etags
[
$eid
][
'sub'
];
# 获取并打乱该元素的次要特征队列
shuffle
(
$esubkey
);
# 遍历该元素的次要特征队列,将特征价值与元素剩余数量比对
foreach
(
$esubkey
as
$sub
)
{
$sub_value
=
emix_calc_subtag_value
(
$sub
,
$emix_itme
,
$emix_itmk
,
$data
);
# 满足价值要求的情况下,扣除对应数量的元素,并将该特征加入次要特征队列内
if
(
$sub_value
<
$emnums
[
$ekey
])
{
$subtags
[]
=
$sub
;
$emnums
[
$ekey
]
-=
$sub_value
;
# 将探索到的次要特征加入笔记内
$eskey
=
array_search
(
$sub
,
$temp_etags
[
$eid
][
'sub'
]);
if
(
empty
(
$clbpara
[
'elements'
][
'tags'
][
$eid
][
'sub'
][
$eskey
]))
$clbpara
[
'elements'
][
'tags'
][
$eid
][
'sub'
][
$eskey
]
=
1
;
}
if
(
$emnums
[
$ekey
]
<
0
)
break
;
}
}
}
return
$subtags
;
}
# 根据获取到的次要特征输出属性
function
emix_spawn_itmsk
(
$subtags
,
$itmk
,
&
$data
,
$emix_flag
=
NULL
)
{
global
$log
,
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$sk
=
Array
();
# 计算道具最多能生成的属性数量上限(当前等级的平方根;最少会生成1个属性;最多可以生成7个属性)
$max_sk
=
max
(
1
,
min
(
7
,
ceil
(
sqrt
(
$lvl
))));
# 如果未生成随机的属性组合条件,先生成属性组合条件
if
(
empty
(
$gamevars
[
'rand_emixsubres'
]))
$gamevars
[
'rand_emixsubres'
]
=
esp_spawn_rand_emixsubres
();
# 如果传入的次要特征数量>1 进行组合判断
if
(
count
(
$subtags
)
>
1
)
{
# 合并固定配方与随机配方
$submix_list
=
array_merge_recursive
(
$submix_list
,
$gamevars
[
'rand_emixsubres'
]);
foreach
(
$submix_list
as
$mkey
=>
$minfo
)
{
# 属性组合逻辑:匹配素材数量>=要求素材数量 && 不能重复生成属性
if
(
count
(
array_intersect
(
$subtags
,
$minfo
[
'stuff'
]))
>=
count
(
$minfo
[
'stuff'
])
&&
(
in_array
(
$minfo
[
'result'
],
$repeat_subtags
)
||
!
in_array
(
$minfo
[
'result'
],
$sk
)))
{
# 配方为概率合成 掷骰判定
if
(
isset
(
$minfo
[
'obbs'
]))
{
$obbs
=
$minfo
[
'obbs'
];
if
(
is_array
(
$obbs
))
$obbs
=
isset
(
$obbs
[
$itmk
])
?
$obbs
[
$itmk
]
:
$obbs
[
'default'
];
if
(
rand
(
0
,
100
)
>
$obbs
)
continue
;
}
# 配对成功!消除素材特征
foreach
(
$minfo
[
'stuff'
]
as
$delsub
)
unset
(
$subtags
[
array_search
(
$delsub
,
$subtags
)]);
# 将组合结果加入属性队列
$sk
[]
=
$minfo
[
'result'
];
# 将探索到的次要特征组合加入笔记内
if
(
empty
(
$clbpara
[
'elements'
][
'info'
][
'sd'
][
'sd'
.
$mkey
]))
$clbpara
[
'elements'
][
'info'
][
'sd'
][
'sd'
.
$mkey
]
=
1
;
}
}
}
# 将次要特征合并进待生成的属性队列内
$sk
=
array_merge
(
$sk
,
$subtags
);
# 将传入的道具类别与特征对比,过滤掉一些乱七八糟的属性:
# 只用道具类别的首字母判断
$kind
=
substr
(
$itmk
,
0
,
1
);
foreach
(
$sk
as
$key
=>
$skv
)
{
//武器上不会生成“防御性”属性
if
(
$kind
==
'W'
&&
in_array
(
$skv
,
$itmk_to_itmsk_tags
[
'D'
]))
unset
(
$sk
[
$key
]);
//防具、道具上不会生成“攻击性”属性
if
(
$kind
!=
'W'
&&
in_array
(
$skv
,
$itmk_to_itmsk_tags
[
'W'
]))
unset
(
$sk
[
$key
]);
//补给品只会生成杂项属性
if
(
$kind
!=
'W'
&&
$kind
!=
'D'
&&
!
in_array
(
$skv
,
$itmk_to_itmsk_tags
[
'misc'
]))
unset
(
$sk
[
$key
]);
}
# 从尾部筛出超过生成上限的属性
while
(
count
(
$sk
)
>
$max_sk
)
array_pop
(
$sk
);
return
$sk
;
}
# 为元素合成道具生成名字
function
emix_spawn_itmname
(
$emlist
,
$emnums
,
$domkey
,
$emix_itmk
,
$emix_itme
,
$emix_itms
,
$emix_itmsk
,
&
$data
,
$emix_flag
=
NULL
)
{
global
$log
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
# 获取道具使用的主元素id
$domid
=
$domkey
[
array_rand
(
$domkey
)];
$domid
=
$emlist
[
$domid
];
//出生了!为孩子起个可爱的名字吧
$emix_itm
=
''
;
$emix_itm_prefix
=
''
;
$emix_itm_meta
=
''
;
$emix_itm_tail
=
''
;
$emix_name_brackets
=
''
;
//根据主元素获取修饰前缀词组
$emix_itm_prefix
=
array_rand
(
$emix_name_prefix_arr
[
$domid
]);
$emix_itm_prefix
=
$emix_name_prefix_arr
[
$domid
][
$emix_itm_prefix
];
//随便挑一个元素的元词缀词组
$meta_emlist_id
=
(
$emix_flag
==
4
||
$emix_flag
==-
2
)
?
6
:
array_rand
(
$emlist
);
//大成功、失败事件可以使用拓展1词组
$emix_itm_meta
=
array_rand
(
$emix_name_meta_arr
[
$meta_emlist_id
]);
$emix_itm_meta
=
$emix_name_meta_arr
[
$meta_emlist_id
][
$emix_itm_meta
];
//根据生成的类别获取尾巴词组
$tmp_kind
=
$emix_itmk
;
//过滤掉道具的子类别
$tmp_kind
=
filter_itemkind
(
$emix_itmk
,
1
);
if
(
strpos
(
$tmp_kind
,
'H'
)
===
0
)
$tmp_kind
=
'H'
;
//TODO:提供了单独的道具类别词组后删掉这一句
//复合武器
if
(
is_array
(
$tmp_kind
))
{
//把两种武器的词尾组合起来 可能会生成很怪很怪的东西!!
for
(
$k
=
0
;
$k
<=
count
(
$tmp_kind
);
$k
++
)
{
$tmp_k_name
=
$emix_name_tail_arr
[
$tmp_kind
[
$k
]][
array_rand
(
$emix_name_tail_arr
[
$tmp_kind
[
$k
]])];
//第一种武器的词尾只保留前两个字 嘻嘻
if
(
$k
==
0
)
$tmp_k_name
=
mb_substr
(
$tmp_k_name
,
0
,
2
,
'utf-8'
);
$emix_itm_tail
.=
$tmp_k_name
;
}
}
else
{
//根据类别获取词尾 如果没有对应类别的词尾则生成泛用性词尾
$emix_itm_tail
=
$emix_name_tail_arr
[
$tmp_kind
]
?
$emix_name_tail_arr
[
$tmp_kind
][
array_rand
(
$emix_name_tail_arr
[
$tmp_kind
])]
:
$emix_name_tail_arr
[
'0'
][
array_rand
(
$emix_name_tail_arr
[
'0'
])];
}
//(只有生成的是武器时才会)根据合成出的道具效果生成一个能大幅提升时髦值的括号
if
(
strpos
(
$emix_itmk
,
'W'
)
===
0
)
{
$emix_name_brackets
=
(
$emix_itme
/
100
)
+
rand
(
-
1
,
1
);
$emix_name_brackets
=
min
(
max
(
0
,
$emix_name_brackets
),
count
(
$emix_name_brackets_arr
)
-
rand
(
1
,
2
));
$emix_name_brackets
=
explode
(
'+'
,
$emix_name_brackets_arr
[
$emix_name_brackets
]);
}
//出生!
$emix_itm
=
$emix_itm_prefix
.
$emix_itm_meta
.
$emix_itm_tail
;
if
(
!
empty
(
$emix_name_brackets
))
$emix_itm
=
$emix_name_brackets
[
0
]
.
$emix_itm
.
$emix_name_brackets
[
1
];
return
$emix_itm
;
}
# 生成随机配方
function
esp_spawn_rand_emixfixres
()
{
global
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
# 如果未生成随机的属性组合条件,先生成属性组合条件
$gamevars
[
'rand_emixfixres'
]
=
Array
();
foreach
(
$rand_emix_fixlist
as
$ekey
=>
$elist
)
{
foreach
(
$elist
[
'stuff'
]
as
$eid
=>
$enum
)
{
# 随机取一种元素
$s_eid
=
array_rand
(
$elements_info
);
# 在区间内给定该元素的值
$enum
=
explode
(
'-'
,
substr
(
$enum
,
1
));
$s_enum
=
rand
(
$enum
[
0
],
$enum
[
1
]);
# 登记并保存在gamevars内
$gamevars
[
'rand_emixfixres'
][
$ekey
][
'stuff'
][
$eid
]
=
Array
(
$s_eid
,
$s_enum
);
}
}
save_gameinfo
();
return
$gamevars
[
'rand_emixfixres'
];
}
# 生成随机次要特征组合配方
function
esp_spawn_rand_emixsubres
()
{
global
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
# 如果未生成随机的属性组合条件,先生成属性组合条件
$gamevars
[
'rand_emixsubres'
]
=
Array
();
foreach
(
$random_submix_list
as
$mainkey
=>
$slist
)
{
foreach
(
$slist
[
'stuff'
]
as
$sid
=>
$snum
)
{
# 前缀以“v_”表示的,代表要选用一个在对应价值以上的属性
if
(
strpos
(
$snum
,
'v_'
)
===
0
)
{
$snum
=
str_replace
(
'v_'
,
''
,
$snum
);
do
{
$skey
=
array_rand
(
$flip_s_tag
);
$sv
=
emix_calc_subtag_value
(
$skey
,
0
,
'default'
,
$data
);
}
while
(
$sv
<
$snum
);
}
# 前缀以“tags_”表示的,代表要选用带有对应标签的属性
elseif
(
strpos
(
$snum
,
'tags_'
)
===
0
)
{
$snum
=
$itmk_to_itmsk_tags
[
str_replace
(
'tags_'
,
''
,
$snum
)];
shuffle
(
$snum
);
$skey
=
$snum
[
0
];
}
else
{
$skey
=
$snum
;
}
# 登记并保存在gamevars内
$gamevars
[
'rand_emixsubres'
][
$mainkey
][
'stuff'
][
$sid
]
=
$skey
;
}
$gamevars
[
'rand_emixsubres'
][
$mainkey
][
'obbs'
]
=
$slist
[
'obbs'
];
$gamevars
[
'rand_emixsubres'
][
$mainkey
][
'result'
]
=
$slist
[
'result'
];
}
save_gameinfo
();
return
$gamevars
[
'rand_emixsubres'
];
}
?>
\ No newline at end of file
include/game/elementmix.func.php
View file @
6bded008
...
...
@@ -3,178 +3,242 @@
if
(
!
defined
(
'IN_GAME'
))
{
exit
(
'Access Denied'
);
}
//zai jian le suoyoude global
global
$gamecfg
,
$elements_info
;
//这个$gamecfg到底是在哪定义的……
require_once
'./include/game/dice.func.php'
;
include_once
config
(
'elementmix'
,
$gamecfg
);
include_once
GAME_ROOT
.
'./include/game/elementmix.calc.php'
;
/********界面交互部分********/
//显示元素数量
function
print_elements_info
()
# 显示已了解的元素特征
function
emix_init_elements_tags
(
$eid
,
$etype
,
$ekey
,
$data
)
{
global
$elements_info
,
$log
;
$log
.=
"当前的<span class='lime'>元素存量</span>如下:<br><span class='grey'>(将鼠标悬浮在元素上可以查看其特征)</span><br>"
;
foreach
(
$elements_info
as
$e_key
=>
$e_info
)
{
global
$
{
'element'
.
$e_key
};
if
(
$
{
'element'
.
$e_key
})
{
$log
.=
"<span tooltip=
\"
"
.
print_elements_tags
(
$e_key
)
.
"
\"
>"
;
$log
.=
"◆
{
$e_info
}
:
{${
'element'
.
$e_key
}}
份;"
;
$log
.=
"</span><br>"
;
}
global
$log
,
$mode
,
$typeinfo
,
$elements_info
,
$gamecfg
,
$gamevars
,
$iteminfo
,
$itemspkinfo
;
include
config
(
'elementmix'
,
$gamecfg
);
extract
(
$data
,
EXTR_REFS
);
$tagdesc
=
$etype
==
'dom'
?
'[主]'
:
'[次]'
;
if
(
!
empty
(
$clbpara
[
'elements'
][
'tags'
][
$eid
][
$etype
][
$ekey
]))
{
$tagid
=
$temp_etags
[
$eid
][
$etype
][
$ekey
];
$tagcolor
=
$etype
==
'dom'
?
''
:
''
;
$tagtype
=
$etype
==
'dom'
?
'iteminfo'
:
'itemspkinfo'
;
$tagskdesc
=
$$tagtype
[
$tagid
];
if
(
$tagskdesc
==
'重击辅助'
)
$tagskdesc
=
'重击'
;
if
(
$tagskdesc
==
'HP制御'
)
$tagskdesc
=
'制御'
;
if
(
$tagskdesc
==
'陷阱探测'
)
$tagskdesc
=
'探雷'
;
$tag
=
"<span class=
\"
{
$tagcolor
}
\"
>
{
$tagdesc
}{
$tagskdesc
}
</span>"
;
}
$log
.=
"<br>"
;
}
//显示元素标签
function
print_elements_tags
(
$e_key
)
{
global
$temp_etags
,
$iteminfo
,
$itemspkinfo
;
$tinfo
=
"已了解的特征:"
;
foreach
(
$temp_etags
[
$e_key
]
as
$tk
=>
$tarr
)
else
{
if
(
is_array
(
$tarr
))
{
foreach
(
$tarr
as
$tm
)
$tinfo
.=
$tk
==
'dom'
?
"[主]"
.
$iteminfo
[
$tm
]
.
" "
:
"[次]"
.
$itemspkinfo
[
$tm
]
.
" "
;
}
$tag
=
"<span class=
\"
grey
\"
>?</span>"
;
}
return
$t
info
;
return
$t
ag
;
}
/********拆解元素部分********/
//过滤掉不能拆解的道具(数组) 不能分解返回1 能分解返回0
function
split_to_elements_filter
(
$i
)
# 显示已了解的元素配方
function
emix_init_elements_info
(
$data
)
{
global
$no_itm_to_e_list
,
$no_itmk_to_e_list
,
$no_itmsk_to_e_list
;
if
(
$i
)
global
$elements_info
,
$r_elements_info
,
$gamecfg
,
$gamevars
,
$iteminfo
,
$itemspkinfo
;
include
config
(
'elementmix'
,
$gamecfg
);
extract
(
$data
,
EXTR_REFS
);
include_once
GAME_ROOT
.
'./include/game/itemplace.func.php'
;
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'd'
]))
{
//过滤不能分解的道具种类
if
((
!
is_array
(
$i
[
'itmk'
])
&&
in_array
(
$i
[
'itmk'
],
$no_itmk_to_e_list
))
||
(
is_array
(
$i
[
'itmk'
])
&&
array_intersect
(
$i
[
'itmk'
],
$no_itmsk_to_e_list
)))
return
1
;
//过滤不能分解的道具名
foreach
(
$no_itm_to_e_list
as
$no_itm
)
$smhint
=
'<span class="blueseed b">已了解到的元素配方(按顺序投入):</span><br><ul>'
;
foreach
(
$emix_fixlist
as
$key
=>
$list
)
{
if
(
preg_match
(
"/
$no_itm
/"
,
$i
[
'itm'
]))
return
1
;
}
//过滤不能分解的道具属性
if
(
$i
[
'itmsk'
])
{
//把道具属性打散成数组
$tmp_itmsk_arr
=
get_itmsk_array
(
$i
[
'itmsk'
]);
if
(
array_intersect
(
$tmp_itmsk_arr
,
$no_itmsk_to_e_list
))
return
1
;
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'd'
][
'd'
.
$key
]))
{
$smhint
.=
'<li style="margin-left:-20px"><span>'
;
foreach
(
$list
[
'stuff'
]
as
$skey
=>
$slist
)
{
if
(
$skey
!=
0
)
$smhint
.=
' + '
;
$smhint
.=
"<span class=''>
{
$slist
[
1
]
}
份</span>
{
$r_elements_info
[
$slist
[
0
]]
}
"
;
}
$smhint
.=
" → <span class=''>"
.
parse_itemmix_resultshow
(
$list
[
'result'
])
.
"</span>"
;
$smhint
.=
'</span></li>'
;
}
}
return
0
;
$smhint
.=
'</ul>'
;
}
return
1
;
}
//把尸体打散成元素
function
split_corpse_to_elements
(
&
$edata
)
{
$ev_arr
=
Array
();
if
(
$edata
)
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'hd'
]))
{
global
$elements_info
,
$no_type_to_e_list
,
$split_corpse_lvl_r
,
$split_spcorpse_fix
,
$typeinfo
;
global
$log
,
$rp
,
$mode
;
//过滤不能分解的尸体
if
(
in_array
(
$edata
[
'type'
],
$no_type_to_e_list
))
$smhint
.=
'<br><span class="blueseed b">奇怪的配方:</span><br><ul>'
;
foreach
(
$gamevars
[
'rand_emixfixres'
]
as
$key
=>
$list
)
{
$log
.=
"无法从
{
$edata
[
'name'
]
}
身上提炼元素……为什么呢?<br><br>"
;
$mode
=
'command'
;
return
;
}
//成功从尸体中提炼元素
$log
.=
"<span class='grey'>
{
$edata
[
'name'
]
}
化作点点荧光四散开来……</span><br>"
;
//处理绑定有秘钥的尸体
if
(
$split_spcorpse_fix
[
$edata
[
'type'
]])
{
$ek_arr
=
Array
();
unset
(
$ekey
);
unset
(
$ev
);
//获取缓存文件
$re_list
=
merge_random_emix_list
();
//还原配方与素材键名
$e_list
=
is_array
(
$split_spcorpse_fix
[
$edata
[
'type'
]])
?
$split_spcorpse_fix
[
$edata
[
'type'
]][
$edata
[
'name'
]]
:
$split_spcorpse_fix
[
$edata
[
'type'
]];
$e_list
=
explode
(
'-'
,
str_replace
(
'r_'
,
''
,
$e_list
));
//$e_list[0]:配方键名 $e_list[1]:素材所在数组内的位置(不是元素编号)
if
(
$e_list
[
1
]
==
'r'
)
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'hd'
][
'h'
.
$key
]))
{
//返回随机素材
$ekey
=
array_rand
(
$re_list
[
$e_list
[
0
]][
'stuff'
]);
$ev
=
$re_list
[
$e_list
[
0
]][
'stuff'
][
$ekey
];
$smhint
.=
'<li style="margin-left:-20px"><span>'
;
foreach
(
$list
[
'stuff'
]
as
$skey
=>
$slist
)
{
if
(
$skey
!=
0
)
$smhint
.=
' + '
;
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'hd'
][
'h'
.
$key
][
's'
.
$skey
]))
{
$smhint
.=
"<span class=''>
{
$slist
[
1
]
}
份 </span>
{
$r_elements_info
[
$slist
[
0
]]
}
"
;
}
else
{
$smhint
.=
"<span class='grey'>??</span>"
;
}
}
$smhint
.=
" → <span class=''>"
.
parse_itemmix_resultshow
(
$rand_emix_fixlist
[
$key
][
'result'
])
.
"</span>"
;
$smhint
.=
'</span></li>'
;
}
else
}
$smhint
.=
'</ul>'
;
}
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'dd'
]))
{
$smhint
.=
'<br><span class="blueseed b">已了解到的主要特征组合式:</span><br><ul>'
;
foreach
(
$dommix_list
as
$key
=>
$list
)
{
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'dd'
][
'dd'
.
$key
]))
{
//返回指定位置素材 遍历配方 找到它的家
$e_sort
=
0
;
foreach
(
$re_list
[
$e_list
[
0
]][
'stuff'
]
as
$stuff_key
=>
$stuff_num
)
$smhint
.=
'<li style="margin-left:-20px"><span>'
;
foreach
(
$list
[
'stuff'
]
as
$skey
=>
$slist
)
{
if
(
$e_sort
==
$e_list
[
1
])
{
$ekey
=
$stuff_key
;
$ev
=
$stuff_num
;
break
;
}
$e_sort
++
;
if
(
$skey
!=
0
)
$smhint
.=
' + '
;
$smhint
.=
"<span class='grey'>[主]</span>"
.
parse_info_desc
(
$slist
,
'k'
)
.
""
;
}
$smobbs
=
!
empty
(
$list
[
'obbs'
])
?
'('
.
$list
[
'obbs'
]
.
'%)'
:
''
;
$smhint
.=
" → <span class='grey'>
{
$smobbs
}
</span>"
.
parse_info_desc
(
$list
[
'result'
],
'k'
)
.
""
;
$smhint
.=
'</span></li>'
;
}
$log
.=
"<span class='grey'>你发现从
{
$typeinfo
[
$edata
[
'type'
]]
}
身上飘落的<span class='red'>
{
$ev
}
</span>份
{
$elements_info
[
$ekey
]
}
样子有点奇怪……怎么回事呢?</span><br>"
;
$ek_arr
[
$ekey
]
+=
$ev
;
}
//根据尸体等级计算能获得的全种类元素数量
$ev_lvl
=
ceil
(
$edata
[
'lvl'
]
*
$split_corpse_lvl_r
);
//把尸体上的装备道具一起打包
$corpse_itm_arr
=
pack_corpse
(
$edata
);
//计算从尸体的装备上能获得的元素种类与数量
$ev_arr
=
get_evalues_by_iarr
(
$corpse_itm_arr
);
//增加对应的元素
$total_addev
=
0
;
foreach
(
$elements_info
as
$e_key
=>
$e_info
)
$smhint
.=
'</ul>'
;
}
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'sd'
]))
{
$smhint
.=
'<br><span class="blueseed b">已了解到的次要特征组合式:</span><br><ul>'
;
$submix_list
=
array_merge_recursive
(
$submix_list
,
$gamevars
[
'rand_emixsubres'
]);
foreach
(
$submix_list
as
$key
=>
$list
)
{
global
$
{
'element'
.
$e_key
};
$add_ev
=
$ev_arr
[
$e_key
]
+
$ev_lvl
+
$ek_arr
[
$e_key
];
//如果尸体上有元素,一并获取,不过现在还不能在npc配置文件里预设NPC出生时带的元素
//瞄了眼NPC初始化的函数,要改的话不如一步到位都改了。
//TODO:创建一个同步player表字段的函数,在NPC初始化时对NPC数据格式化,插入数据库时用格式化后的数组,这样以后添加新字段也不再需要动初始化函数了
if
(
$edata
[
'element'
.
$e_key
])
if
(
!
empty
(
$clbpara
[
'elements'
][
'info'
][
'sd'
][
'sd'
.
$key
]))
{
$add_ev
+=
$edata
[
'element'
.
$e_key
];
$edata
[
'element'
.
$e_key
]
=
0
;
$smhint
.=
'<li style="margin-left:-20px"><span>'
;
foreach
(
$list
[
'stuff'
]
as
$skey
=>
$slist
)
{
if
(
$skey
!=
0
)
$smhint
.=
' + '
;
$smhint
.=
"<span class='grey'>[次]</span>"
.
parse_info_desc
(
$slist
,
'sk'
)
.
""
;
}
$smobbs
=
!
empty
(
$list
[
'obbs'
])
?
'('
.
$list
[
'obbs'
]
.
'%)'
:
''
;
$smhint
.=
" → <span class='grey'>
{
$smobbs
}
</span>"
.
parse_info_desc
(
$list
[
'result'
],
'sk'
)
.
""
;
$smhint
.=
'</span></li>'
;
}
$
{
'element'
.
$e_key
}
+=
$add_ev
;
$total_addev
+=
$add_ev
;
$log
.=
"获得了
{
$add_ev
}
份
{
$e_info
}
!<br>"
;
}
//分解的结果有参数合法的特殊道具
if
(
is_array
(
$ev_arr
[
'spitm'
])
&&
count
(
$ev_arr
[
'spitm'
])
>
3
)
$smhint
.=
'</ul>'
;
}
return
$smhint
;
}
function
print_elements_tags
(
$e_key
)
{
global
$elements_info
,
$gamecfg
,
$iteminfo
,
$itemspkinfo
;
include
config
(
'elementmix'
,
$gamecfg
);
$tinfo
=
"已了解的特征:"
;
foreach
(
$temp_etags
[
$e_key
]
as
$tk
=>
$tarr
)
{
if
(
is_array
(
$tarr
))
{
global
$itm0
,
$itmk0
,
$itme0
,
$itms0
,
$itmsk0
;
$log
.=
"但出现在你面前的不是元素,而是<span class='yellow'>
{
$ev_arr
[
'result'
][
0
]
}
</span>!<br>……这是什么情况……!?<br>"
;
$itm0
=
$ev_arr
[
'result'
][
0
];
$itmk0
=
$ev_arr
[
'result'
][
1
];
$itmsk0
=
$ev_arr
[
'result'
][
4
];
$itme0
=
$ev_arr
[
'result'
][
2
];
$itms0
=
$ev_arr
[
'result'
][
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
foreach
(
$tarr
as
$tm
)
$tinfo
.=
$tk
==
'dom'
?
"[主]"
.
$iteminfo
[
$tm
]
.
" "
:
"[次]"
.
$itemspkinfo
[
$tm
]
.
" "
;
}
//销毁尸体
destory_corpse
(
$edata
);
//你们也一块去吧!
unset
(
$ev_arr
);
unset
(
$corpse_itm_arr
);
//炼人油败人品
//$ep_dice = diceroll($total_addev);
$ep_dice
=
rand
(
0
,
$total_addev
);
if
(
$ep_dice
>
70
)
}
return
$tinfo
;
}
/********拆解元素部分********/
# 把尸体打散成元素
function
split_corpse_to_elements
(
&
$edata
)
{
global
$log
,
$mode
,
$typeinfo
,
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
$club
!=
20
)
{
$log
.=
"你还想对这具可怜的尸体干什么?<br>"
;
$mode
=
'command'
;
return
;
}
# 过滤不能分解的尸体
if
(
in_array
(
$edata
[
'type'
],
$no_type_to_e_list
))
{
$log
.=
"无法从
{
$edata
[
'name'
]
}
身上提炼元素……为什么呢?<br>"
;
$mode
=
'command'
;
return
;
}
# 开始提炼尸体
$ev_arr
=
Array
();
$log
.=
"<span class='grey'>
{
$edata
[
'name'
]
}
化作点点荧光四散开来……</span><br>"
;
# 处理绑定有秘钥的尸体
if
(
!
empty
(
$split_spcorpse_fix
[
$edata
[
'type'
]]))
esplit_vip_things
(
$ev_arr
,
$edata
,
$data
);
# 根据尸体等级计算能获得的全种类元素数量
$ev_lvl
=
ceil
(
$edata
[
'lvl'
]
*
$split_corpse_lvl_r
);
# 遍历尸体上的装备道具,计算能获得的元素种类与数量
# 打包
$corpse_itm_arr
=
pack_corpse
(
$edata
);
# 计算从尸体的装备上能获得的元素种类与数量
$ev_arr
=
esplit_get_values_by_iarr
(
$corpse_itm_arr
,
$ev_arr
,
$data
);
# 应用
$total_addev
=
0
;
foreach
(
$elements_info
as
$e_key
=>
$e_info
)
{
$add_ev
=
ceil
(
$ev_arr
[
$e_key
]
+
$ev_lvl
);
//如果尸体上有元素,一并获取,不过现在还不能在npc配置文件里预设NPC出生时带的元素
if
(
$edata
[
'element'
.
$e_key
])
{
$
rp
+=
$ep_dice
;
$
log
.=
"……但是这一切真的值得吗?<br>"
;
$
add_ev
+=
$edata
[
'element'
.
$e_key
]
;
$
edata
[
'element'
.
$e_key
]
=
0
;
}
$log
.=
"<br>"
;
$
{
'element'
.
$e_key
}
+=
$add_ev
;
$total_addev
+=
$add_ev
;
$log
.=
"获得了
{
$add_ev
}
份
{
$e_info
}
!<br>"
;
}
# 分解的结果有参数合法的特殊道具
if
(
!
empty
(
$ev_arr
[
'spitm'
])
&&
count
(
$ev_arr
[
'spitm'
])
>
3
)
{
global
$itm0
,
$itmk0
,
$itme0
,
$itms0
,
$itmsk0
;
$log
.=
"但出现在你面前的不是元素,而是<span class='yellow'>
{
$ev_arr
[
'result'
][
0
]
}
</span>!<br>……这又是什么鬼东西!<br>"
;
$itm0
=
$ev_arr
[
'result'
][
0
];
$itmk0
=
$ev_arr
[
'result'
][
1
];
$itmsk0
=
$ev_arr
[
'result'
][
4
];
$itme0
=
$ev_arr
[
'result'
][
2
];
$itms0
=
$ev_arr
[
'result'
][
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
}
# 销毁尸体
destory_corpse
(
$edata
);
# 炼人油败人品
$ep_dice
=
rand
(
0
,
$total_addev
);
if
(
$ep_dice
>
70
)
{
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
rpup_rev
(
$data
,
$ep_dice
);
$log
.=
"……但是这一切真的值得吗?<br>"
;
}
$log
.=
"<br>"
;
$mode
=
'command'
;
return
;
}
//把道具打散成元素 改下传入的参数其实也可以拆装备
# 将道具分解为元素
function
split_item_to_elements
(
$iid
=
NULL
)
{
global
$club
,
$log
,
$rp
,
$mode
,
$name
;
global
$log
,
$mode
,
$typeinfo
,
$elements_info
,
$gamecfg
,
$gamevars
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
if
(
$club
!=
20
)
{
$log
.=
"你的手突然掐住了你的头左右摇摆!<br><span class='yellow'>“你还想要干什么,啊?你还想要干什么!!”</span><br>看来你的手和脑子之间起了一点小摩擦。<br><br>"
;
...
...
@@ -184,8 +248,6 @@
$i_arr
=
Array
();
if
(
isset
(
$iid
))
{
global
$elements_info
,
$itmk_to_e_list
;
global
$
{
'itm'
.
$iid
},
$
{
'itmk'
.
$iid
},
$
{
'itme'
.
$iid
},
$
{
'itms'
.
$iid
},
$
{
'itmsk'
.
$iid
};
if
(
!
$
{
'itms'
.
$iid
})
{
$log
.=
"道具来源非法。<br>"
;
...
...
@@ -193,6 +255,7 @@
return
;
}
//打包
$ev_arr
=
Array
();
$i_arr
[
'itm'
.
$iid
][
'itme'
]
=
$
{
'itme'
.
$iid
};
$i_arr
[
'itm'
.
$iid
][
'itms'
]
=
$
{
'itms'
.
$iid
};
$i_arr
[
'itm'
.
$iid
][
'itm'
]
=
$
{
'itm'
.
$iid
};
$i_arr
[
'itm'
.
$iid
][
'itmk'
]
=
$
{
'itmk'
.
$iid
};
$i_arr
[
'itm'
.
$iid
][
'itmsk'
]
=
$
{
'itmsk'
.
$iid
};
//过滤掉不能分解的道具
...
...
@@ -207,40 +270,39 @@
//分解道具获得元素
$log
.=
"<span class='grey'>"
.
$
{
'itm'
.
$iid
}
.
"化作点点荧光四散开来……</span><br>"
;
//计算能获得的元素种类与数量
$
i_arr
=
get_evalues_by_iarr
(
$i_arr
);
$
ev_arr
=
esplit_get_values_by_iarr
(
$i_arr
,
$ev_arr
,
$data
);
//销毁道具
$
{
'itm'
.
$iid
}
=
$
{
'itmk'
.
$iid
}
=
$
{
'itmsk'
.
$iid
}
=
''
;
$
{
'itme'
.
$iid
}
=
$
{
'itms'
.
$iid
}
=
0
;
//增加对应的元素
$total_addev
=
0
;
foreach
(
$
i_arr
as
$e_key
=>
$ev
)
foreach
(
$
ev_arr
as
$e_key
=>
$ev
)
{
if
(
is_array
(
$ev
)
&&
count
(
$ev
)
>
3
)
{
//分解的结果里有参数合法的道具
global
$itm0
,
$itmk0
,
$itme0
,
$itms0
,
$itmsk0
;
$log
.=
"但出现在你面前的不是元素,而是<span class='yellow'>
{
$ev
[
0
]
}
</span>!<br>……这是什么情况……!?<br>"
;
$itm0
=
$ev
[
0
];
$itmk0
=
$ev
[
1
];
$itmsk0
=
$ev
[
4
];
$itme0
=
$ev
[
2
];
$itms0
=
$ev
[
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
}
else
if
(
!
empty
(
$ev
))
{
global
$
{
'element'
.
$e_key
};
$
{
'element'
.
$e_key
}
+=
$ev
;
$total_addev
+=
$ev
;
$log
.=
"获得了
{
$ev
}
份
{
$elements_info
[
$e_key
]
}
!<br>"
;
if
(
is_array
(
$ev
)
&&
count
(
$ev
)
>
3
)
{
$log
.=
"但出现在你面前的不是元素,而是<span class='yellow'>
{
$ev
[
0
]
}
</span>!<br>……这是什么情况……!?<br>"
;
$itm0
=
$ev
[
0
];
$itmk0
=
$ev
[
1
];
$itmsk0
=
$ev
[
4
];
$itme0
=
$ev
[
2
];
$itms0
=
$ev
[
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
}
else
{
$ev
=
ceil
(
$ev
);
$
{
'element'
.
$e_key
}
+=
$ev
;
$total_addev
+=
$ev
;
$log
.=
"获得了
{
$ev
}
份
{
$elements_info
[
$e_key
]
}
!<br>"
;
}
}
}
unset
(
$i_arr
);
//捡垃圾涨功德
//$ep_dice = diceroll($total_addev);
# 捡垃圾有公德
$ep_dice
=
rand
(
0
,
$total_addev
);
if
(
$ep_dice
>
0
)
{
$rp
=
$rp
-
$ep_dice
;
//rp可以为负吗?
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
rpup_rev
(
$data
,
-
$ep_dice
);
}
$log
.=
"<br>"
;
}
...
...
@@ -248,393 +310,160 @@
return
;
}
/
/通过输入的道具/装备数组计算对应的元素价值
//输入的iarr默认的格式:$iarr=Array('arb或itm0'=>Array('itm'=>$arb或$itm0,'itmk'=>$arbk或$itmk0.....),)
function
get_evalues_by_iarr
(
$iar
r
)
/
********元素合成部分********/
# 元素合成准备阶段:处理从界面传入的数据
function
elements_mix_prepare
(
$list
,
$nums
,
$itmemax
,
$itme
r
)
{
global
$log
,
$nosta
,
$elements_info
,
$temp_etags
;
global
$split_itm_fix
,
$split_spitm_fix
,
$split_itmk_r
,
$split_default_itmk_r
;
global
$split_itmsk_fix
,
$split_default_itmsk_fix
;
global
$log
,
$elements_info
,
$gamecfg
;
if
(
!
isset
(
$data
))
{
global
$pdata
;
$data
=
&
$pdata
;
}
extract
(
$data
,
EXTR_REFS
);
$ev_arr
=
Array
();
//获取缓存文件
$cache_file
=
GAME_ROOT
.
"./gamedata/bak/elementmix.bak.php"
;
if
(
!
file_exists
(
$cache_file
))
create_emix_cache_file
();
//$cache_arr = openfile_decode($cache_file);
include_once
$cache_file
;
//开始计算元素价值
foreach
(
$iarr
as
$i
=>
$t
)
if
(
$club
!=
20
)
{
//最优先:检查拆解特定道具(全名匹配)时的事件
if
(
isset
(
$split_itm_fix
[
$t
[
'itm'
]]))
{
unset
(
$ekey
);
unset
(
$ev
);
//处理秘钥道具
if
(
strpos
(
$split_itm_fix
[
$t
[
'itm'
]],
'r_'
)
===
0
)
{
//还原配方与素材键名 暂时不考虑秘钥道具=>array的情况 有需要的情况再现加
//$e_list[0]:配方键名 $e_list[1]:素材所在数组内的位置(不是元素编号)
$e_list
=
explode
(
'-'
,
str_replace
(
'r_'
,
''
,
$split_itm_fix
[
$t
[
'itm'
]]));
//返回随机素材
if
(
$e_list
[
1
]
==
'r'
)
{
$ekey
=
array_rand
(
$cache_arr
[
'random_emix_list'
][
$e_list
[
0
]][
'stuff'
]);
$ev
=
$cache_arr
[
'random_emix_list'
][
$e_list
[
0
]][
'stuff'
][
$ekey
];
}
//返回指定位置素材 遍历配方 找到它的家
else
{
$e_sort
=
0
;
foreach
(
$cache_arr
[
'random_emix_list'
][
$e_list
[
0
]][
'stuff'
]
as
$stuff_key
=>
$stuff_num
)
{
if
(
$e_sort
==
$e_list
[
1
])
{
$ekey
=
$stuff_key
;
$ev
=
$stuff_num
;
break
;
}
$e_sort
++
;
}
}
$log
.=
"<span class='grey'>你发现构成
{
$t
[
'itm'
]
}
的<span class='red'>
{
$ev
}
</span>份
{
$elements_info
[
$ekey
]
}
样子有点奇怪……怎么回事呢?</span><br>"
;
$ev_arr
[
$ekey
]
+=
$ev
;
//润!
continue
;
}
//处理吐出来的道具,一次分解最多只会吐一个道具,后到先得。
elseif
(
is_array
(
$split_itm_fix
[
$t
[
'itm'
]][
'spitm'
]))
{
if
(
isset
(
$ev_arr
[
'spitm'
]))
unset
(
$ev_arr
[
'spitm'
]);
$ev_arr
[
'spitm'
]
=
$split_itm_fix
[
$t
[
'itm'
]][
'spitm'
];
continue
;
}
foreach
(
$split_itm_fix
[
$t
[
'itm'
]]
as
$ekey
=>
$ev
)
$log
.=
"你思考了一会儿,还是没明白你到底想要干什么……<br>"
;
return
;
}
# 打散队列
$list
=
explode
(
'+'
,
$list
);
$nums
=
explode
(
'+'
,
$nums
);
# 素材队列上限:6种
if
(
count
(
$list
)
>
6
||
count
(
$nums
)
>
6
)
{
$log
.=
"你投入的元素种类过多,元素们在锅里打起来了,甚至把你也波及到了!<br>
你被元素们打得奄奄一息!<br>"
;
$hp
=
1
;
return
;
}
# 处理传入的系数
if
(
$itmemax
>
100
||
$itmemax
<
1
)
$itmemax
=
100
;
if
(
$itmer
>
98
||
$itmer
<
1
)
$itmer
=
55
;
$emixarr
=
Array
();
$emixnums
=
Array
();
$farr
=
Array
();
# 检查素材合法性
$domkey
=
Array
();
$domnum
=
0
;
for
(
$i
=
0
;
$i
<=
count
(
$list
);
$i
++
)
{
if
(
isset
(
$list
[
$i
])
&&
!
empty
(
$nums
[
$i
]))
{
# 登记合成素材队列中第i号位使用的元素种类
$emixarr
[
$i
]
=
$list
[
$i
];
# 登记合成素材队列中第i号位使用的元素数量
$emixnums
[
$i
]
=
$nums
[
$i
];
# 检查对应种类元素是否超过库存
if
(
empty
(
$farr
[
$emixarr
[
$i
]]))
$farr
[
$emixarr
[
$i
]]
=
0
;
$farr
[
$emixarr
[
$i
]]
+=
$emixnums
[
$i
];
if
(
$farr
[
$emixarr
[
$i
]]
>
$
{
'element'
.
$emixarr
[
$i
]})
{
$ev_arr
[
$ekey
]
+=
$ev
;
$log
.=
"
{
$elements_info
[
$emixarr
[
$i
]]
}
库存不足,无法合成。<br>"
;
return
;
}
//echo "【DEBUG】检查到了特殊道具【{$t['itm']}】<br>";
continue
;
//道具在特判列表里 不再继续计算后面的内容 直接跳到下一个道具
}
//次优先:检查拆解特定道具(关键词匹配)时的事件
foreach
(
$split_spitm_fix
as
$spitm
=>
$sp_ev
)
{
$sp_flag
=
0
;
if
(
preg_match
(
"/
$spitm
/"
,
$t
[
'itm'
]))
{
//没有指定获得哪种元素 随机获得一种元素
if
(
!
is_array
(
$sp_ev
))
{
$ev_arr
[
array_rand
(
$elements_info
)]
+=
$sp_ev
;
}
else
{
foreach
(
$sp_ev
as
$ekey
=>
$ev
)
$ev_arr
[
$ekey
]
+=
$ev
;
unset
(
$ekey
);
unset
(
$ev
);
}
$sp_flag
=
1
;
//道具在特判列表里 不再继续计算后面的内容 直接跳到下一个道具
//echo "【DEBUG】检查到了特殊道具【{$t['itm']}】<br>";
}
}
//道具不能分解 跳过
if
(
split_to_elements_filter
(
$t
)
||
$sp_flag
)
continue
;
//通过道具的效果、耐久,确定原始价值
if
(
$t
[
'itms'
]
==
$nosta
)
$t
[
'itms'
]
=
rand
(
1
,
10
);
$base_ev
=
round
((
$t
[
'itme'
]
+
$t
[
'itms'
])
/
2
);
//echo "【DEBUG】{$t['itm']}的基础价值是{$base_ev}<br>";
//通过道具类别获取价值修正
$k_t
=
$t
[
'itmk'
];
if
(
isset
(
$split_itmk_r
[
$k_t
]))
{
//存在对应修正 优先获取
$k_ev_r
=
$split_itmk_r
[
$k_t
];
}
else
{
//不存在对应修正 先尝试过滤类别
$k_t
=
filter_itemkind
(
$k_t
);
//没有对应修正关系则返回默认类别的分解系数
$k_ev_r
=
isset
(
$split_itmk_r
[
$k_t
])
?
$split_itmk_r
[
$k_t
]
:
$split_default_itmk_r
;
}
//应用价值修正
$base_ev
=
ceil
(
$base_ev
*
$k_ev_r
);
//echo "【DEBUG】{$t['itm']}的类别价值修正系数是{$k_ev_r},修正后的价值是{$base_ev}。<br>";
//通过道具类别关联元素
$k_t
=
$t
[
'itmk'
];
$k_ekey
=
''
;
if
(
isset
(
$cache_arr
[
'flip_d_tag'
][
$k_t
]))
{
//存在对应元素 优先获取
$k_ekey
=
$cache_arr
[
'flip_d_tag'
][
$k_t
];
}
else
{
//不存在对应元素 先尝试过滤类别
$k_t
=
filter_itemkind
(
$k_t
);
//还是没有对应元素 返回随机一种元素
$k_ekey
=
isset
(
$cache_arr
[
'flip_d_tag'
][
$k_t
])
?
$cache_arr
[
'flip_d_tag'
][
$k_t
]
:
array_rand
(
$elements_info
);
}
//echo "【DEBUG】【{$t['itmk']}】{$t['itm']}关联到的元素是【{$elements_info[$k_ekey]}】<br>";
//应用 类别=>元素 的价值
$ev_arr
[
$k_ekey
]
+=
$base_ev
;
//通过属性计算道具的附加价值
if
(
isset
(
$t
[
'itmsk'
]))
{
$t
[
'itmsk'
]
=
get_itmsk_array
(
$t
[
'itmsk'
]);
foreach
(
$t
[
'itmsk'
]
as
$tsk
)
# 检查是否为主元素
if
(
$emixnums
[
$i
]
>=
$domnum
-
10
)
{
//获取单个属性关联的元素 没有则随机挑选一个元素
$ekey
=
$cache_arr
[
'flip_s_tag'
][
$tsk
]
?
$cache_arr
[
'flip_s_tag'
][
$tsk
]
:
array_rand
(
$elements_info
);
if
(
isset
(
$ekey
))
{
$add_ev
=
0
;
//获取属性价值
if
(
$split_itmsk_fix
[
$tsk
])
{
if
(
is_array
(
$split_itmsk_fix
[
$tsk
]))
{
$add_ev
=
$split_itmsk_fix
[
$tsk
][
$t
[
'itmk'
]]
?
$split_itmsk_fix
[
$tsk
][
$t
[
'itmk'
]]
:
$split_itmsk_fix
[
$tsk
][
'default'
];
}
else
{
$add_ev
=
$split_itmsk_fix
[
$tsk
];
}
}
else
{
$add_ev
=
$split_default_itmsk_fix
;
}
//入列!
$ev_arr
[
$ekey
]
+=
$add_ev
;
//echo "【DEBUG】{$t['itm']}的【属性{$tsk}】分解出了{$add_ev}份{$elements_info[$ekey]}<br>";
}
$domnum
=
$emixnums
[
$i
];
$domkey
[]
=
$i
;
}
}
}
return
$ev_arr
;
if
(
!
empty
(
$emixarr
)
&&
!
empty
(
$emixnums
))
{
element_mix
(
$emixarr
,
$emixnums
,
$domkey
,
$itmemax
,
$itmer
);
}
return
;
}
/********元素合成部分********/
//元素喝茶
function
element_mix
(
$emlist
,
$eitme_max_r
=
NULL
,
$eitme_r
=
NULL
)
# 元素合成主流程
function
element_mix
(
$emlist
,
$emnums
,
$domkey
,
$eitmemax
=
100
,
$eitmesr
=
55
)
{
global
$now
,
$name
,
$log
,
$iteminfo
,
$itemspkinfo
,
$elements_info
;
global
$no_emix_circulation
;
global
$emix_luck_info
,
$emix_tips_arr
,
$emix_name_brackets_arr
,
$emix_name_prefix_arr
,
$emix_name_meta_arr
,
$emix_name_tail_arr
;
global
$itm0
,
$itmk0
,
$itme0
,
$itms0
,
$itmsk0
,
$clbpara
;
global
$now
,
$log
,
$iteminfo
,
$itemspkinfo
,
$elements_info
,
$gamecfg
;
include
config
(
'elementmix'
,
$gamecfg
);
if
(
!
$emlist
)
if
(
!
isset
(
$data
)
)
{
$log
.=
"你不能用不存在的东西合成!<br>"
;
return
;
global
$pdata
;
$data
=
&
$pdata
;
}
//尝试
合成时 合成操作计数+1
extract
(
$data
,
EXTR_REFS
);
# 尝试元素
合成时 合成操作计数+1
if
(
empty
(
$clbpara
[
'achvars'
][
'immix'
]))
$clbpara
[
'achvars'
][
'immix'
]
=
1
;
//输入了合法的元素参数,先初始化一些变量。
$c_times
=
0
;
$total_enum
=
0
;
$dom_ekey
=
-
1
;
$dom_enum
=
-
1
;
$multi_dom_ekey
=
Array
();
$emix_flag
=
NULL
;
$emix_fix
=
NULL
;
//自定义效/耐比的阈值:2%~98%
$eitme_r
=
isset
(
$eitme_r
)
?
min
(
98
,
max
(
2
,
$eitme_r
))
:
rand
(
2
,
98
);
$eitme_r
/=
100
;
//自定义最大效果的阈值:1%~100%
$eitme_max_r
=
isset
(
$eitme_max_r
)
?
min
(
100
,
max
(
1
,
$eitme_max_r
))
:
100
;
$eitme_max_r
/=
100
;
//对参与合成的元素按投入数量降序排序,筛出投入数量最多的元素作为主元素
arsort
(
$emlist
);
$log
.=
"从口袋中抓出了:<br>"
;
foreach
(
$emlist
as
$ekey
=>
$enum
)
# 素材位置 => 元素id
$dom_log
=
Array
();
$total_enum
=
0
;
foreach
(
$emlist
as
$ekey
=>
$eid
)
{
if
(
$c_times
==
0
)
{
//登记主元素
$dom_ekey
=
$ekey
;
$dom_enum
=
$enum
;
}
else
{
//其他投入的元素数量与主元素数量相差10以内 也可以提供主要特征
if
(
$enum
>=
(
$dom_enum
-
10
))
$multi_dom_ekey
[
$ekey
]
=
$enum
;
//log修正
$log
.=
"、"
;
}
$log
.=
"
{
$enum
}
份
{
$elements_info
[
$ekey
]
}
"
;
$c_times
++
;
//登记投入的元素总量,用于计算效果、耐久
$enum
=
$emnums
[
$ekey
];
$dom_log
[]
=
"
{
$enum
}
份
{
$elements_info
[
$eid
]
}
"
;
# 登记投入的元素总量,用于计算效果、耐久;
$total_enum
+=
$enum
;
//实际扣除投入元素,关于元素数量的合法性在提交合成时就判断过了,这里就不重复判断了
global
$
{
'element'
.
$ekey
};
$
{
'element'
.
$ekey
}
-=
$enum
;
# 扣除实际投入元素;
$
{
'element'
.
$eid
}
-=
$enum
;
}
if
(
!
empty
(
$dom_log
))
$log
.=
implode
(
'、'
,
$dom_log
);
$log
.=
"。<br>你紧张地搓了搓手。<br>合成开始了。<br>"
;
//检查是否存在固定合成
$emix_fix
=
check_in_emix_list
(
$emlist
);
if
(
$emix_fix
)
{
$log
.=
"<br>但是出现结果的速度比你想象中要快得多!<br>你还没反应过来,元素们就把一样东西吐了出来!<br><br>"
;
$itm0
=
$emix_fix
[
0
];
$itmk0
=
$emix_fix
[
1
];
$itmsk0
=
$emix_fix
[
4
];
$itme0
=
$emix_fix
[
2
];
$itms0
=
$emix_fix
[
3
];
include_once
GAME_ROOT
.
'./include/game/itemmain.func.php'
;
itemget
();
addnews
(
$now
,
'emix_success'
,
$name
,
$emix_fix
[
0
]);
return
;
}
# 判断合成是否存在固定结果
$flag
=
emix_check_fix_result
(
$emlist
,
$emnums
,
$data
);
if
(
$flag
)
return
;
//开始随机
合成:
# 开始随机结果
合成:
$log
.=
"<span class='grey'>…加入了一点
{
$emix_tips_arr
[
array_rand
(
$emix_tips_arr
)]
}
…</span><br>"
;
//掷骰:
//$emix_dice = diceroll(100);
$emix_dice
=
rand
(
1
,
100
);
switch
(
$emix_dice
)
{
case
$emix_dice
<=
5
:
//大成功
$emix_flag
=
4
;
break
;
case
$emix_dice
<=
15
:
//出色表现
$emix_flag
=
3
;
break
;
case
$emix_dice
<=
50
:
//成功
$emix_flag
=
2
;
break
;
case
$emix_dice
<=
96
:
//普通
$emix_flag
=
1
;
break
;
default
:
//哇 这下便样衰了!(道具会带有灵魂绑定属性 可恶 为什么诅咒属性不见了)
$emix_flag
=
-
2
;
}
# 检查随机合成运势:
$emix_flag
=
emix_check_mix_luck
();
$log
.=
"<span class='grey'>你感觉
{
$emix_luck_info
[
$emix_flag
]
}
</span><br>"
;
//
生成道具类别:
# 开始
生成道具类别:
$emix_itmk
=
''
;
//获取主特征:
$emix_itmk_tags
=
Array
();
$emix_itmk_tags
[]
=
get_emix_dom_tags
(
$dom_ekey
,
$dom_enum
);
//有备选的主特征列表,依次获取
if
(
count
(
$multi_dom_ekey
)
>
0
)
{
foreach
(
$multi_dom_ekey
as
$md_ekey
=>
$md_enum
)
{
$emix_itmk_tags
[]
=
get_emix_dom_tags
(
$md_ekey
,
$md_enum
);
}
}
//用获取到的主特征(是个数组)确定道具类别
$emix_itmk
=
get_emix_itmk
(
$emix_itmk_tags
,
$emix_flag
);
# 取得主特征:
$emix_itmk_tags
=
emix_get_domtags
(
$emlist
,
$emnums
,
$domkey
,
$data
);
# 用获取到的主特征(是个数组)确定道具类别
$emix_itmk
=
emix_spawn_itmk
(
$emix_itmk_tags
,
$emix_flag
);
$log
.=
"<span class='clan'>你观察到自己投入进去的那坨混合物慢慢有了形状,它似乎能被用作<span class='yellow'>
{
$iteminfo
[
$emix_itmk
]
}
</span>。</span><br>"
;
$log
.=
"<span class='grey'>…再加一些
{
$emix_tips_arr
[
array_rand
(
$emix_tips_arr
)]
}
…</span><br>"
;
//生成道具效果、耐久:
$emix_itme
=
0
;
$emix_itms
=
0
;
//根据投入的元素总量 计算其中能够转化为效果、耐久的部分(不会超过当前等级的理论上限值)
$cost_enum
=
get_emix_max_cost
(
$total_enum
,
$eitme_max_r
);
//获取道具效耐比(随机2~98)。$eitem_r:解锁自定义比例功能后,可以自己设置固定的效耐比。
$emix_itme_r
=
$eitme_r
;
$emix_itms_r
=
1
-
$emix_itme_r
;
//计算道具效果、耐久
$emix_itme
=
(
$emix_flag
==
4
)
?
$cost_enum
:
ceil
(
$cost_enum
*
$emix_itme_r
*
(
$emix_flag
/
10
+
1
));
//只投入1份元素,至少也会有1点效果、1点耐久。你赚了我亏了好吧!
$emix_itms
=
(
$emix_flag
==
4
)
?
'∞'
:
ceil
(
$cost_enum
*
$emix_itms_r
*
(
$emix_flag
/
10
+
1
));
//大成功情况下获得无限耐久
if
(
strpos
(
$emix_itmk
,
'D'
)
===
0
&&
$emix_itms
==
'∞'
)
$emix_itms
=
$emix_itme
;
//防具没有这种待遇
//临时的道具效果修正:强化药物道具效果上限
if
(
strpos
(
$emix_itmk
,
'M'
)
===
0
||
strpos
(
$emix_itmk
,
'HM'
)
===
0
)
{
$emix_itme
=
ceil
(
min
(
30
*
(
$emix_flag
/
10
+
1
),
$emix_itme
));
$emix_itms
=
ceil
(
min
(
2
*
(
$emix_flag
/
10
+
1
),
$emix_itms
));
}
# 开始生成道具效果、耐久:
$esarr
=
emix_spawn_itmes
(
$emlist
,
$emnums
,
$domkey
,
$eitmemax
,
$eitmesr
,
$total_enum
,
$emix_itmk
,
$data
,
$emix_flag
);
if
(
!
$esarr
)
goto
emix_failed_flag
;
$emix_itme
=
$esarr
[
0
];
$emix_itms
=
$esarr
[
1
];
$log
.=
"<span class='clan'>在那形状愈发明晰的时候,你听到<span class='yellow'>
{
$cost_enum
}
</span>份</span>
{
$elements_info
[
$dom_ekey
]
}
<span class='clan'>在升腾的雾气中喃喃呓语。</span><br>"
;
$log
.=
"<span class='clan'>在那形状愈发明晰的时候,你听到<span class='yellow'>
"
.
(
$emix_itme
+
$emix_itms
)
.
"</span>份</span>
{
$elements_info
[
$emlist
[
$domkey
[
0
]]
]
}
<span class='clan'>在升腾的雾气中喃喃呓语。</span><br>"
;
$log
.=
"<span class='grey'>…哎呀,不小心混入了一点
{
$emix_tips_arr
[
array_rand
(
$emix_tips_arr
)]
}
…</span><br>"
;
//生成道具属性:
$emix_itmsk
=
(
$no_emix_circulation
||
$emix_flag
==-
2
)
?
Array
(
'v'
)
:
Array
();
//是否固定带有灵魂绑定属性
$emix_itmsk_max
=
(
$no_emix_circulation
||
$emix_flag
==-
2
)
?
4
:
5
;
//最多能生成几个属性
//获取次要特征:
$emix_itmsk_tags
=
Array
();
foreach
(
$emlist
as
$ekey
=>
$enum
)
# 生成道具属性:
$emix_itmsk
=
Array
();
# 大失败的情况下,道具带有灵魂绑定属性:
if
(
$no_emix_circulation
||
$emix_flag
==
-
2
)
$emix_itmsk
[]
=
'v'
;
# 大成功情况下,道具带有菁英属性:
if
(
$emix_flag
==
4
)
$emix_itmsk
[]
=
'Z'
;
# 生成道具效果、耐久后,元素数量还有盈余的情况下,生成道具属性
if
(
$total_enum
>
0
)
{
//把生成道具效果、耐久吃掉的元素,根据投入比例分摊到参与合成的元素上
//计算每个元素实际的消耗
$tmp_cost
=
round
(
$cost_enum
*
(
$enum
/
$total_enum
));
$enum
-=
$tmp_cost
;
//计算消耗后如果还有盈余,才会检查元素是否有能用来生成属性的次要特征。
//基本逻辑:低面板出属性代价低,高面板出属性代价高。
if
(
$enum
>
0
)
# 获取元素的次要特征队列:
$subtags
=
emix_get_subtags
(
$emlist
,
$emnums
,
$emix_itme
,
$emix_itmk
,
$data
,
$emix_flag
);
# 获取到了特征队列大于0,把次要特征转化为道具属性:
if
(
!
empty
(
$subtags
))
{
//获取次要特征
$tmp_emix_itmsk
_tags
=
Array
(
);
$
tmp_emix_itmsk_tags
=
get_emix_sub_tags
(
$ekey
,
$enum
,
$emix_itmk
,
$emix_flag
);
$
emix_itmsk_tags
=
array_merge
(
$tmp_emix_itmsk_tags
,
$emix_itmsk_tags
)
;
# 转换为道具属性
$tmp_emix_itmsk
=
emix_spawn_itmsk
(
$subtags
,
$emix_itmk
,
$data
,
$emix_flag
);
$
emix_itmsk
=
array_merge
(
$emix_itmsk
,
$tmp_emix_itmsk
);
$
log
.=
"<span class='clan'>闻到了硫磺、莎草纸、</span>
{
$elements_info
[
$emlist
[
array_rand
(
$emlist
)]]
}
<span class='clan'>与</span><span class='yellow'>"
.
(
count
(
$subtags
))
.
"种发酵物</span><span class='clan'>混合的味道。</span><br>"
;
}
}
//获取到了次要特征,把次要特征转化为道具属性:
if
(
count
(
$emix_itmsk_tags
)
>
0
)
{
//第三个参数:能保留的属性数量上限
$emix_itmsk
=
array_merge
(
$emix_itmsk
,
get_emix_itmsk
(
$emix_itmsk_tags
,
$emix_itmk
,
$emix_itmsk_max
));
}
//把itmsk从数组转回字符串
# 将itmsk从数组转回字符串
$emix_itmsk
=
get_itmsk_strlen
(
$emix_itmsk
);
$log
.=
"<span class='clan'>闻到了硫磺、莎草纸、</span>
{
$elements_info
[
array_rand
(
$emlist
)]
}
<span class='clan'>与</span><span class='yellow'>"
.
(
count
(
$emix_itmsk_tags
)
+
1
)
.
"种发酵物</span><span class='clan'>混合的味道。</span><br>"
;
//(TODO:合成事件结算阶段)
$log
.=
"<span class='grey'>…最后再加一点
{
$emix_tips_arr
[
array_rand
(
$emix_tips_arr
)]
}
…</span><br><br>"
;
$log
.=
"结束了…?<br><br>"
;
//出生了!为孩子起个可爱的名字吧
$emix_itm
=
''
;
$emix_itm_prefix
=
''
;
$emix_itm_meta
=
''
;
$emix_itm_tail
=
''
;
$emix_name_brackets
=
''
;
//根据主元素获取修饰前缀词组
$emix_itm_prefix
=
array_rand
(
$emix_name_prefix_arr
[
$dom_ekey
]);
$emix_itm_prefix
=
$emix_name_prefix_arr
[
$dom_ekey
][
$emix_itm_prefix
];
//随便挑一个元素的元词缀词组
$meta_emlist_id
=
(
$emix_flag
==
4
||
$emix_flag
==-
2
)
?
6
:
array_rand
(
$emlist
);
//大成功、失败事件可以使用拓展1词组
$emix_itm_meta
=
array_rand
(
$emix_name_meta_arr
[
$meta_emlist_id
]);
$emix_itm_meta
=
$emix_name_meta_arr
[
$meta_emlist_id
][
$emix_itm_meta
];
//根据生成的类别获取尾巴词组
$tmp_kind
=
$emix_itmk
;
//过滤掉道具的子类别
$tmp_kind
=
filter_itemkind
(
$emix_itmk
,
1
);
if
(
strpos
(
$tmp_kind
,
'H'
)
===
0
)
$tmp_kind
=
'H'
;
//TODO:提供了单独的道具类别词组后删掉这一句
//复合武器
if
(
is_array
(
$tmp_kind
))
{
//把两种武器的词尾组合起来 可能会生成很怪很怪的东西!!
for
(
$k
=
0
;
$k
<=
count
(
$tmp_kind
);
$k
++
)
{
$tmp_k_name
=
$emix_name_tail_arr
[
$tmp_kind
[
$k
]][
array_rand
(
$emix_name_tail_arr
[
$tmp_kind
[
$k
]])];
//第一种武器的词尾只保留前两个字 嘻嘻
if
(
$k
==
0
)
$tmp_k_name
=
mb_substr
(
$tmp_k_name
,
0
,
2
,
'utf-8'
);
$emix_itm_tail
.=
$tmp_k_name
;
}
}
else
{
//根据类别获取词尾 如果没有对应类别的词尾则生成泛用性词尾
$emix_itm_tail
=
$emix_name_tail_arr
[
$tmp_kind
]
?
$emix_name_tail_arr
[
$tmp_kind
][
array_rand
(
$emix_name_tail_arr
[
$tmp_kind
])]
:
$emix_name_tail_arr
[
'0'
][
array_rand
(
$emix_name_tail_arr
[
'0'
])];
}
//(只有生成的是武器时才会)根据合成出的道具效果生成一个能大幅提升时髦值的括号
if
(
strpos
(
$emix_itmk
,
'W'
)
===
0
)
{
$emix_name_brackets
=
(
$emix_itme
/
100
)
+
rand
(
-
1
,
1
);
$emix_name_brackets
=
min
(
max
(
0
,
$emix_name_brackets
),
count
(
$emix_name_brackets_arr
)
-
rand
(
1
,
2
));
$emix_name_brackets
=
explode
(
'+'
,
$emix_name_brackets_arr
[
$emix_name_brackets
]);
}
//出生!
$emix_itm
=
$emix_name_brackets
[
0
]
.
$emix_itm_prefix
.
$emix_itm_meta
.
$emix_itm_tail
.
$emix_name_brackets
[
1
];
$emix_itm
=
emix_spawn_itmname
(
$emlist
,
$emnums
,
$domkey
,
$emix_itmk
,
$emix_itme
,
$emix_itms
,
$emix_itmsk
,
$data
,
$emix_flag
);
if
(
$emix_itm
&&
$emix_itmk
&&
$emix_itme
&&
$emix_itms
)
{
...
...
@@ -646,226 +475,24 @@
}
else
{
emix_failed_flag
:
$log
.=
"<span class='red'>……合成失败了!<br>你投入进去的元素也全部打了水漂!<br>怎么这样……</span><br>"
;
addnews
(
$now
,
'emix_failed'
,
$name
);
}
# 只要不是大失败,每次进行元素合成都能获得一定的经验
if
(
$emix_flag
>
0
)
$exp
+=
rand
(
1
,
$emix_flag
);
return
;
}
//获取当前等级合成出的道具效果上限 这个上限实际上是耐久+效果共用的
//有点蛋疼
function
get_emix_itme_max
()
{
global
$max_emix_itme_start
,
$max_emix_itme_up
;
global
$lvl
;
//每1级能够提升的上限值 (前32级时的计算公式:基础+提升值*等级*(255-等级)%)(32级后:基础+(提升值+等级)*等级))
$max_itme
=
$lvl
<
31
?
$max_emix_itme_start
+
(
$max_emix_itme_up
*
$lvl
*
((
255
-
$lvl
)
/
255
))
:
$max_emix_itme_start
+
((
$max_emix_itme_up
+
$lvl
)
*
$lvl
);
$max_itme
=
ceil
(
$max_itme
);
return
$max_itme
;
}
//通过投入的元素数量 判断合成时最多有多少元素可以转化为效果、耐久
function
get_emix_max_cost
(
$total_enum
,
$emr
=
1
)
{
//获取理论上限
$max_enum
=
get_emix_itme_max
();
//通过自定义上限系数修正
$max_enum
*=
$emr
;
//判断投入数量有没有超过理论上限
$max_cost
=
min
(
round
(
$max_enum
),
$total_enum
);
return
$max_cost
;
}
//判断是否存在固定合成
function
check_in_emix_list
(
$emlist
)
# 初始化
function
emix_spawn_info
()
{
global
$emix_list
,
$random_emix_list
;
//先检查固定合成
foreach
(
$emix_list
as
$elist
)
{
if
(
!
array_diff
(
$emlist
,
$elist
[
'stuff'
])
&&
count
(
$emlist
)
==
count
(
$elist
[
'stuff'
]))
{
return
$elist
[
'result'
];
}
}
//再检查随机合成:尝试获取随机合成配方
$r_emix_list
=
merge_random_emix_list
();
foreach
(
$r_emix_list
as
$rid
=>
$relist
)
{
if
(
!
array_diff
(
$emlist
,
$relist
[
'stuff'
])
&&
count
(
$emlist
)
==
count
(
$relist
[
'stuff'
]))
{
return
$r_emix_list
[
$rid
][
'result'
];
}
}
return
;
}
//获取元素主特征
function
get_emix_dom_tags
(
$ekey
,
$enum
)
{
global
$elements_info
,
$temp_etags
;
//拉取元素对应的主特征
$dom_tag
=
$temp_etags
[
$ekey
][
'dom'
];
//只有一个主特征 直接返回
if
(
count
(
$dom_tag
)
==
1
)
return
$dom_tag
[
0
];
//有多个主特征 按规律返回
//判断投入的元素是单数还是双数份
$tag_flag
=
fmod
(
$enum
,
2
);
//规律:投入单数份元素,返回第0个主特征;否则返回第1个主特征。如果以后有第2、3、4个主特征呢?以后的事情以后再说吧。
$dom_tag
=
$tag_flag
?
$dom_tag
[
0
]
:
$dom_tag
[
1
];
return
$dom_tag
;
}
//根据主特征输出道具类别
function
get_emix_itmk
(
$dom_tags
,
$emix_flag
=
NULL
)
{
global
$dommix_list
;
$emix_itmk
=
''
;
$obbs_fix
=
0
;
//根据合成表现修正概率
if
(
$emix_flag
)
$obbs_fix
=
$emix_flag
*
10
;
if
(
count
(
$dom_tags
)
>
1
)
{
//存在复数个主特征,判断能否进行组合
$mixflag
=
false
;
foreach
(
$dommix_list
as
$minfo
)
{
//直接抄合成匹配逻辑了 有一种野性的美
if
(
!
array_diff
(
$dom_tags
,
$minfo
[
'stuff'
])
&&
!
array_diff
(
$minfo
[
'stuff'
],
$dom_tags
)
&&
count
(
$dom_tags
)
==
count
(
$minfo
[
'stuff'
]))
{
//if($minfo['obbs'] && (diceroll(100)-$obbs_fix)>$minfo['obbs']) continue;
if
(
$minfo
[
'obbs'
]
&&
(
rand
(
0
,
100
)
-
$obbs_fix
)
>
$minfo
[
'obbs'
])
continue
;
//配方为概率合成 掷骰判定没通过 跳过
$emix_itmk
=
$minfo
[
'result'
];
$mixflag
=
true
;
break
;
}
}
//没有匹配的组合 随机返回一个主特征作为类别
if
(
!
$mixflag
)
$emix_itmk
=
$dom_tags
[
array_rand
(
$dom_tags
)];
}
else
{
//只有一个主特征 直接让它作为类别返回
$emix_itmk
=
$dom_tags
[
0
];
}
return
$emix_itmk
;
global
$gamevars
;
if
(
empty
(
$gamevars
[
'rand_emixfixres'
]))
esp_spawn_rand_emixfixres
();
if
(
empty
(
$gamevars
[
'rand_emixsubres'
]))
esp_spawn_rand_emixsubres
();
}
//获取元素次要特征
function
get_emix_sub_tags
(
$ekey
,
$enum
,
$kind
,
$emix_flag
)
{
global
$elements_info
,
$temp_etags
;
global
$split_default_itmsk_fix
,
$split_itmsk_fix
;
$subtags
=
Array
();
//获取元素所有的次要特征
$e_sub_tags
=
$temp_etags
[
$ekey
][
'sub'
];
//筛选出投入数量大于属性价值的次要特征
foreach
(
$e_sub_tags
as
$etag
)
{
//获取属性价值
if
(
$split_itmsk_fix
[
$etag
])
{
if
(
is_array
(
$split_itmsk_fix
[
$etag
]))
{
$evalues
=
$split_itmsk_fix
[
$etag
][
$kind
]
?
$split_itmsk_fix
[
$etag
][
$kind
]
:
$split_itmsk_fix
[
$etag
][
'default'
];
}
else
{
$evalues
=
$split_itmsk_fix
[
$etag
];
}
}
else
{
$evalues
=
$split_default_itmsk_fix
;
}
//配吗?
if
(
$enum
>=
$evalues
)
$sub_tags
[
$etag
]
=
$evalues
;
}
//扣除元素存量,并随机生成特征:
$e_sub_tags
=
Array
();
$tn
=
0
;
if
(
count
(
$sub_tags
)
>
0
)
{
//骰一个生成的次要特征上限
$tag_max
=
rand
(
0
,
count
(
$sub_tags
))
+
$emix_flag
;
do
{
$skey
=
array_rand
(
$sub_tags
);
$enum
-=
$sub_tags
[
$skey
];
$e_sub_tags
[]
=
$skey
;
unset
(
$sub_tags
[
$skey
]);
$tn
++
;
}
while
(
$tn
<
$tag_max
&&
count
(
$sub_tags
)
>
0
);
}
return
$e_sub_tags
;
}
//根据次要特征输出道具属性 $max_sk:输出的属性数量上限
function
get_emix_itmsk
(
$sub_tags
,
$kind
,
$max_sk
=
5
)
{
global
$submix_list
,
$itmk_to_itmsk_tags
;
$sk_value
=
Array
();
//对传入的次要特征进行组合判断
if
(
count
(
$sub_tags
)
>
1
)
{
//存在复数个次要特征,判断能否进行组合
//尝试获取随机配方
$r_submix_list
=
merge_random_emix_list
(
1
);
//合并固定配方与随机配方
$submix_list
=
array_merge_recursive
(
$r_submix_list
,
$submix_list
);
foreach
(
$submix_list
as
$minfo
)
{
//属性组合逻辑:匹配素材数量>=要求素材数量 && 不能重复生成属性
if
(
count
(
array_intersect
(
$sub_tags
,
$minfo
[
'stuff'
]))
>=
count
(
$minfo
[
'stuff'
])
&&
!
in_array
(
$minfo
[
'result'
],
$sk_value
))
{
//配方为概率合成 掷骰判定
if
(
$minfo
[
'obbs'
])
{
//获取概率修正
if
(
is_array
(
$minfo
[
'obbs'
]))
{
$obbs
=
$minfo
[
'obbs'
][
$kind
]
?
$minfo
[
'obbs'
][
$kind
]
:
$minfo
[
'obbs'
][
'default'
];
}
else
{
$obbs
=
$minfo
[
'obbs'
];
}
//if(diceroll(100)>$minfo['obbs']) continue;
if
(
rand
(
0
,
100
)
>
$minfo
[
'obbs'
])
continue
;
}
//配对成功!消除素材特征
foreach
(
$minfo
[
'stuff'
]
as
$m_sub_tags
)
{
unset
(
$sub_tags
[
array_search
(
$m_sub_tags
,
$sub_tags
)]);
}
//把组合结果丢进待生成的属性队列内
$sk_value
[]
=
$minfo
[
'result'
];
break
;
}
}
}
//将次要特征合并进待生成的属性队列内
$sk_value
=
array_merge
(
$sk_value
,
$sub_tags
);
//将传入的道具类别与特征对比,过滤掉一些乱七八糟的属性:
$kind
=
substr
(
$kind
,
0
,
1
);
//只用道具类别的首字母判断……这个叫什么?大类!
foreach
(
$sk_value
as
$key_sk
=>
$sk
)
{
//武器上不会生成“防御性”属性
if
(
$kind
==
'W'
&&
in_array
(
$sk
,
$itmk_to_itmsk_tags
[
'D'
]))
unset
(
$sk_value
[
$key_sk
]);
//防具、道具上不会生成“攻击性”属性
if
(
$kind
!=
'W'
&&
in_array
(
$sk
,
$itmk_to_itmsk_tags
[
'W'
]))
unset
(
$sk_value
[
$key_sk
]);
//补给品只会生成杂项属性
if
(
$kind
!=
'W'
&&
$kind
!=
'D'
&&
!
in_array
(
$sk
,
$itmk_to_itmsk_tags
[
'misc'
]))
unset
(
$sk_value
[
$key_sk
]);
}
//从尾部筛出超过生成上限的属性
while
(
count
(
$sk_value
)
>
$max_sk
)
{
//shuffle($sub_tags); //按照原顺序筛出,可以优先保留组合出的属性
array_pop
(
$sk_value
);
}
return
$sk_value
;
}
//翻转标签数组 以通过类型/属性找到对应的元素
# 翻转标签数组 以通过类型/属性找到对应的元素(已废弃)
function
flip_temp_etags
(
$tags_arr
)
{
$cache_arr
=
Array
();
...
...
@@ -884,125 +511,6 @@
return
$cache_arr
;
}
//打印随机合成结果 记得先执行上面那个翻转数组 把翻转后的数组传进这里 才能确保生成随机属性组合时每个素材都有源头元素
function
create_random_emix_list
(
$cache_arr
)
{
global
$elements_info
,
$split_itmsk_fix
,
$split_default_itmsk_fix
,
$itmk_to_itmsk_tags
;
global
$random_emix_list
,
$random_submix_list
;
$emix_arr
=
Array
();
//先处理随机合成
foreach
(
$random_emix_list
as
$eid
=>
$elist
)
{
$emix_arr
[
'random_emix_list'
][
$eid
][
'stuff'
]
=
Array
();
//缓存文件里只保存键值和配方
foreach
(
$elist
[
'stuff'
]
as
$ekey
=>
$enum
)
{
do
{
$ekey
=
array_rand
(
$elements_info
);
}
while
(
isset
(
$emix_arr
[
'random_emix_list'
][
$eid
][
'stuff'
][
$ekey
]));
$enum
=
explode
(
'-'
,
substr
(
$enum
,
1
));
$enum
=
rand
(
$enum
[
0
],
$enum
[
1
]);
$emix_arr
[
'random_emix_list'
][
$eid
][
'stuff'
][
$ekey
]
=
$enum
;
}
}
//然后处理随机属性……呃啊
//所有参与属性组合的“特征” 都应该存在于传入的$cache_arr(翻转数组)里 这样才能确保它是有“源头”的
foreach
(
$random_submix_list
as
$sid
=>
$slist
)
{
$emix_arr
[
'random_smix_list'
][
$sid
][
'stuff'
]
=
Array
();
foreach
(
$slist
[
'stuff'
]
as
$skey
=>
$snum
)
{
$skey
=
''
;
if
(
strpos
(
$snum
,
'sk_'
)
===
0
)
{
$skey
=
str_replace
(
'sk_'
,
''
,
$snum
);
}
elseif
(
strpos
(
$snum
,
'v_'
)
===
0
)
{
$snum
=
str_replace
(
'v_'
,
''
,
$snum
);
do
{
$skey
=
array_rand
(
$cache_arr
[
'flip_s_tag'
]);
$sv
=
$split_itmsk_fix
[
$skey
]
?
$split_itmsk_fix
[
$skey
]
:
$split_default_itmsk_fix
;
if
(
is_array
(
$sv
))
$sv
=
$sv
[
'default'
];
}
while
(
$sv
<
$snum
||
in_array
(
$emix_arr
[
'random_smix_list'
][
$sid
][
'stuff'
]));
}
elseif
(
strpos
(
$snum
,
'tags_'
)
===
0
)
{
$snum
=
$itmk_to_itmsk_tags
[
str_replace
(
'tags_'
,
''
,
$snum
)];
do
{
shuffle
(
$snum
);
$skey
=
$snum
[
0
];
}
while
(
in_array
(
$emix_arr
[
'random_smix_list'
][
$sid
][
'stuff'
])
||
!
array_key_exists
(
$skey
,
$cache_arr
[
'flip_s_tag'
]));
}
$emix_arr
[
'random_smix_list'
][
$sid
][
'stuff'
][]
=
$skey
;
}
}
return
array_merge
(
$emix_arr
,
$cache_arr
);
}
//合并随机合成模板与素材
function
merge_random_emix_list
(
$type
=
0
)
{
global
$random_emix_list
,
$random_submix_list
;
//获取缓存文件
$cache_file
=
GAME_ROOT
.
"./gamedata/bak/elementmix.bak.php"
;
if
(
!
file_exists
(
$cache_file
))
create_emix_cache_file
();
include_once
$cache_file
;
//用已生成的随机配方替换模板配方
if
(
$type
==
0
)
{
$list
=
$random_emix_list
;
foreach
(
$list
as
$rkey
=>
$rlist
)
{
$list
[
$rkey
][
'stuff'
]
=
$cache_arr
[
'random_emix_list'
][
$rkey
][
'stuff'
];
}
}
else
{
$list
=
$random_submix_list
;
foreach
(
$list
as
$rkey
=>
$rlist
)
{
$list
[
$rkey
][
'stuff'
]
=
$cache_arr
[
'random_smix_list'
][
$rkey
][
'stuff'
];
}
}
return
$list
;
}
//生成元素合成相关的临时配置文件,只在有人用了对应社团卡时执行一次
//现在直接用更优雅的方式生成php格式文件,可以直接include进来。
function
create_emix_cache_file
()
{
global
$temp_etags
,
$gamecfg
,
$gamenum
,
$log
;
$file
=
GAME_ROOT
.
"./gamedata/bak/elementmix.bak.php"
;
if
(
file_exists
(
$file
))
{
//检查本局游戏是不是已经生成过配置文件了
include_once
$file
;
if
(
$cache_arr
[
'gamenum'
]
==
$gamenum
)
{
return
;
$log
.=
"【DEBUG】如果你看到这条信息,请转告管理员:“调试完记得把注释去掉!”<br>"
;
}
else
{
//文件是旧的,直接删掉
unlink
(
$file
);
}
}
//翻转标签
$cache_arr
=
flip_temp_etags
(
$temp_etags
);
//生成随机合成
$cache_arr
=
create_random_emix_list
(
$cache_arr
);
//加入本局游戏编号
$cache_arr
[
'gamenum'
]
=
$gamenum
;
//写入文件
global
$checkstr
;
$cache_str
=
str_replace
(
'?>'
,
''
,
str_replace
(
'<?'
,
'<?php'
,
$checkstr
));
$cache_str
.=
'$cache_arr = '
.
var_export
(
$cache_arr
,
1
)
.
";
\r\n
?>"
;
writeover
(
$file
,
$cache_str
);
//$log.="【DEBUG】生成了本局游戏对应的临时配置文件。<br>";
return
;
}
/********一些可复用函数 也许可以挪到其他地方********/
//打包尸体 ……
...
...
@@ -1059,4 +567,5 @@
}
return
$kind
;
}
?>
\ No newline at end of file
include/game/item.func.php
View file @
6bded008
...
...
@@ -1918,12 +1918,14 @@ function itemuse($itmn,&$data=NULL) {
//社团变更
changeclub
(
20
,
$pdata
);
//获取初始元素与第一条配方
$dice
=
rand
(
0
,
5
);
//global ${'element'.$dice},$clbpara;
$
{
'element'
.
$dice
}
+=
200
+
$dice
;
$dice
=
rand
(
0
,
5
);
$dice2
=
rand
(
0
,
1
);
$dice3
=
rand
(
0
,
3
);
$
{
'element'
.
$dice
}
+=
500
+
$dice
;
$clbpara
[
'elements'
]
=
Array
();
$clbpara
[
'elements'
][
'tags'
]
=
Array
(
$dice
=>
Array
(
'dom'
=>
Array
(
0
=>
1
),
'sub'
=>
Array
(
0
=>
1
)));
$clbpara
[
'elements'
][
'info'
][
'd'
][
'd1'
]
=
1
;
//初始化元素合成缓存文件
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
create_emix_cache_file
();
emix_spawn_info
();
}
elseif
(
$itme
==
21
){
//灵子梦魇特殊处理
$log
.=
"再等等吧……<br>"
;
...
...
@@ -1986,7 +1988,7 @@ function itemuse($itmn,&$data=NULL) {
}
//初始化元素合成缓存文件
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
create_emix_cache_file
();
emix_spawn_info
();
}
elseif
(
$itm
==
'测试用元素大师社团卡'
){
//-----------------------//
//这是一张测试用卡 冴冴可以挑一些用得上的放在使用社团卡后执行的事件里
...
...
@@ -2026,7 +2028,7 @@ function itemuse($itmn,&$data=NULL) {
$
{
'element'
.
$dice
}
+=
200
+
$dice
;
//初始化元素合成缓存文件
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
create_emix_cache_file
();
emix_spawn_info
();
//销毁道具
$itm
=
$itmk
=
$itmsk
=
''
;
$itme
=
$itms
=
0
;
...
...
@@ -2185,28 +2187,25 @@ function itemuse($itmn,&$data=NULL) {
if
(
$club
==
20
&&
strpos
(
$itmk
,
'Y'
)
===
0
&&
strpos
(
$itm
,
'提示纸条'
)
!==
false
)
{
$log
.=
"<br>就在你读完内容打算把纸条收起来时,你愕然发现纸条背面竟然还有字!<br><br>"
;
include
_once
config
(
'elementmix'
,
$gamecfg
);
include
config
(
'elementmix'
,
$gamecfg
);
$log
.=
$emix_slip
[
array_rand
(
$emix_slip
)];
//除商店纸条外:提供一条元素特征(TODO)、或一条固定配方、或一条随机属性组合
$log
.=
"<br><span class='yellow'>附:见面有缘,再送你一条提示吧:<br>“将带有"
;
include_once
GAME_ROOT
.
'./include/game/elementmix.func.php'
;
if
(
!
preg_match
(
'/(A|B|C|D)/'
,
$itm
))
{
//野生纸条:给随机属性组合提示
$s_list
=
merge_random_emix_list
(
1
);
$s_id
=
array_rand
(
$s_list
);
$s_result
=
$itemspkinfo
[
$random_submix_list
[
$s_id
][
'result'
]];
}
else
{
//商店纸条:给固定属性组合提示
$s_list
=
$submix_list
;
$s_id
=
array_rand
(
$s_list
);
$s_result
=
$itemspkinfo
[
$s_list
[
$s_id
][
'result'
]];
$submix_list
=
array_merge_recursive
(
$submix_list
,
$gamevars
[
'rand_emixsubres'
]);
}
foreach
(
$s_list
[
$s_id
][
'stuff'
]
as
$skey
)
$log
.=
"【
$itemspkinfo[$skey]
】"
;
$s_id
=
array_rand
(
$submix_list
);
$s_result
=
$itemspkinfo
[
$submix_list
[
$s_id
][
'result'
]];
foreach
(
$submix_list
[
$s_id
][
'stuff'
]
as
$skey
)
$log
.=
"【
$itemspkinfo[$skey]
】"
;
$log
.=
"特征的元素组合起来,就有机会组合出【
{
$s_result
}
】属性。”</span><br>"
;
//阅后即焚
$log
.=
"<br>……说这么多鬼记得住啊!<br>你思考了一下,决定把
{
$itm
}
吃进肚子里,以便慢慢消化其中的知识。<br>"
;
$itms
--
;
# 将提示给到的次要特征组合加入笔记内
if
(
empty
(
$clbpara
[
'elements'
][
'info'
][
'sd'
][
'sd'
.
$s_id
]))
$clbpara
[
'elements'
][
'info'
][
'sd'
][
'sd'
.
$s_id
]
=
1
;
}
if
((
$itms
<=
0
)
&&
(
$itm
))
{
...
...
include/game20130526.js
View file @
6bded008
...
...
@@ -446,6 +446,40 @@ function getEmitmeR(type=0) {
}
}
function
AddElementsToList
(
ekey
,
enums
)
{
var
list
=
$
(
'
emixlist
'
).
value
;
var
nums
=
$
(
'
emixnums
'
).
value
;
var
desc
=
$
(
'
emixinfo
'
).
innerHTML
;
var
keyarr
=
list
.
length
>
0
?
list
.
split
(
'
+
'
)
:
[];
var
numsarr
=
nums
.
length
>
0
?
nums
.
split
(
'
+
'
)
:
[];
var
descarr
=
desc
.
length
>
0
?
desc
.
split
(
'
、
'
)
:
[];
if
(
enums
<=
0
)
{
window
.
alert
(
"
至少要投入1份元素!
"
);
return
;
}
if
((
$
(
'
maxe
'
+
ekey
+
'
num
'
).
value
-
enums
)
<
0
)
{
window
.
alert
(
"
输入了超过了库存的数量。
"
);
return
;
}
if
(
keyarr
.
length
>=
6
)
{
window
.
alert
(
"
最多可分六次投入
"
);
return
;
}
$
(
'
maxe
'
+
ekey
+
'
num
'
).
value
-=
enums
;
$
(
'
e
'
+
ekey
+
'
num
'
).
value
=
$
(
'
maxe
'
+
ekey
+
'
num
'
).
value
;
keyarr
.
push
(
ekey
);
numsarr
.
push
(
enums
);
descarr
.
push
(
enums
+
'
份
'
+
$
(
'
edesc
'
+
ekey
).
innerHTML
);
$
(
'
emixlist
'
).
value
=
keyarr
.
join
(
'
+
'
);
$
(
'
emixnums
'
).
value
=
numsarr
.
join
(
'
+
'
);
$
(
'
emixinfo
'
).
innerHTML
=
descarr
.
join
(
'
、
'
);
$
(
'
emixinfotop
'
).
style
.
display
=
'
block
'
;
}
function
changeVolume
(
cv
){
var
v
=
$
(
'
gamebgm
'
).
volume
;
v
=
v
+
cv
;
...
...
templates/default/command.htm
View file @
6bded008
...
...
@@ -52,13 +52,11 @@
<!-- 第 -1 行:社团提示相关-->
<!--{if $club==19}-->
【
<span
class=
"lime"
>
报应点数:
<span
id=
"anum"
>
$rp
</span></span>
】
<br>
<!--{elseif $club==20}-->
<a
onclick=
"$('mode').value='itemmain';$('command').value='elementbag';postCmd('gamecmd','command.php');this.disabled=true;"
>
【
<span
class=
"sparkle"
>
{$sparkle}元素口袋{$sparkle}
</span>
】
</a><br>
<!--{/if}-->
<!-- 第 1 行 : 包裹相关-->
<!--{if $club==20}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"元素
合成
"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"elementmix"
name=
"elementmix"
value=
"元素
口袋
"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<!--{else}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"itemmix"
name=
"itemmix"
value=
"道具合成"
onclick=
"$('command').value='itemmain';$('subcmd').name='itemcmd';$('subcmd').value='itemmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<!--{/if}-->
...
...
templates/default/elementmix.htm
View file @
6bded008
<!-- 元素名 -->
<div
style=
"display: none;"
>
<!--{loop range(0,5) $ekey}-->
<span
id=
"edesc$ekey"
>
$elements_info[$ekey]
</span>
<!--{/loop}-->
</div>
<!-- 元素选取模块 -->
<input
type=
"hidden"
id=
"emixlist"
name=
"emixlist"
value=
""
>
<input
type=
"hidden"
id=
"emixnums"
name=
"emixnums"
value=
""
>
<!-- 主界面 -->
你在你的小口袋里翻找起来……
<br>
打算组合哪些元素?
<br>
<input
type=
"hidden"
id=
"emax"
name=
"emax"
value=
"$emax"
>
<input
type=
"hidden"
name=
"mode"
value=
"itemmain"
>
<input
type=
"hidden"
name=
"command"
id=
"command"
value=
"menu"
>
<br>
<!--元素选取模块-->
<div
id=
"emixinfotop"
style=
"display: none;"
><span
class=
"yellow"
>
【已投入】
</span></div>
<div
id=
"emixinfo"
></div>
<br>
<style>
div
.emixpage
input
{
max-width
:
55px
;
margin-right
:
5px
;
margin-bottom
:
3px
;
}
</style>
<div
class=
"emixpage"
>
<!--{if $element0}-->
<input
type=
"checkbox"
id=
"mitm1"
name=
"mitm1"
value=
"-1"
><a
onclick=
"$('mitm1').click();"
href=
"javascript:void(0);"
>
$etaginfo0 $elements_info[0] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm0_num"
value=
"$element0"
min=
"0"
max=
"$element0"
oninput=
"if(value>$element0)value=$element0;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(0,$('e0num').value);"
>
$elements_info[0]
<input
type=
"hidden"
id=
"maxe0num"
value=
"$element0"
>
<input
type=
"number"
id=
"e0num"
value=
"$element0"
min=
"0"
max=
"$element0"
oninput=
"if(value>$element0)value=$element0;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
<!--{if $element1}-->
<input
type=
"checkbox"
id=
"mitm2"
name=
"mitm2"
value=
"-1"
><a
onclick=
"$('mitm2').click();"
href=
"javascript:void(0);"
>
$etaginfo1 $elements_info[1] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm1_num"
value=
"$element1"
min=
"0"
max=
"$element1"
oninput=
"if(value>$element1)value=$element1;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(1,$('e1num').value);"
>
$elements_info[1]
<input
type=
"hidden"
id=
"maxe1num"
value=
"$element1"
>
<input
type=
"number"
id=
"e1num"
value=
"$element1"
min=
"0"
max=
"$element1"
oninput=
"if(value>$element1)value=$element1;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
<!--{if $element2}-->
<input
type=
"checkbox"
id=
"mitm3"
name=
"mitm3"
value=
"-1"
><a
onclick=
"$('mitm3').click();"
href=
"javascript:void(0);"
>
$etaginfo2 $elements_info[2] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm2_num"
value=
"$element2"
min=
"0"
max=
"$element2"
oninput=
"if(value>$element2)value=$element2;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(2,$('e2num').value);"
>
$elements_info[2]
<input
type=
"hidden"
id=
"maxe2num"
value=
"$element2"
>
<input
type=
"number"
id=
"e2num"
value=
"$element2"
min=
"0"
max=
"$element2"
oninput=
"if(value>$element2)value=$element2;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
<!--{if $element3}-->
<input
type=
"checkbox"
id=
"mitm4"
name=
"mitm4"
value=
"-1"
><a
onclick=
"$('mitm4').click();"
href=
"javascript:void(0);"
>
$etaginfo3 $elements_info[3] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm3_num"
value=
"$element3"
min=
"0"
max=
"$element3"
oninput=
"if(value>$element3)value=$element3;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(3,$('e3num').value);"
>
$elements_info[3]
<input
type=
"hidden"
id=
"maxe3num"
value=
"$element3"
>
<input
type=
"number"
id=
"e3num"
value=
"$element3"
min=
"0"
max=
"$element3"
oninput=
"if(value>$element3)value=$element3;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
<!--{if $element4}-->
<input
type=
"checkbox"
id=
"mitm5"
name=
"mitm5"
value=
"-1"
><a
onclick=
"$('mitm5').click();"
href=
"javascript:void(0);"
>
$etaginfo4 $elements_info[4] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm4_num"
value=
"$element4"
min=
"0"
max=
"$element4"
oninput=
"if(value>$element4)value=$element4;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(4,$('e4num').value);"
>
$elements_info[4]
<input
type=
"hidden"
id=
"maxe4num"
value=
"$element4"
>
<input
type=
"number"
id=
"e4num"
value=
"$element4"
min=
"0"
max=
"$element4"
oninput=
"if(value>$element4)value=$element4;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
<!--{if $element5}-->
<input
type=
"checkbox"
id=
"mitm6"
name=
"mitm6"
value=
"-1"
><a
onclick=
"$('mitm6').click();"
href=
"javascript:void(0);"
>
$etaginfo5 $elements_info[5] 放入:
</span></a>
<input
type=
"number"
style=
"width:50px"
name=
"emitm5_num"
value=
"$element5"
min=
"0"
max=
"$element5"
oninput=
"if(value>$element5)value=$element5;if(value<0)value=0"
/>
份
<br>
<input
type=
"button"
value=
"投入"
onclick=
"AddElementsToList(5,$('e5num').value);"
>
$elements_info[5]
<input
type=
"hidden"
id=
"maxe5num"
value=
"$element5"
>
<input
type=
"number"
id=
"e5num"
value=
"$element5"
min=
"0"
max=
"$element5"
oninput=
"if(value>$element5)value=$element5;if(value<0)value=0"
/>
份
<br>
<!--{/if}-->
</div>
<br>
<!--自带:通过投入元素数量的奇偶决定道具类别-->
<span
class=
"yellow"
>
【数术】
</span><br>
› 投入份数
<span
class=
"lime"
>
最多(±10)
</span>
的一种或多种元素
<br>
<span
class=
"yellow"
>
【数术】
</span><br>
› 投入份数
<span
class=
"lime"
>
最多(±10)
</span>
的一种或多种元素
<br>
会成为
<span
class=
"lime"
>
主元素
</span>
,影响合成结果的
<span
class=
"lime"
>
类型
</span>
。
<br>
› 投入的主元素为
<span
class=
"redseed"
>
奇
</span>
|
<span
class=
"blueseed"
>
偶
</span>
数份时,元素会展
<br>
› 投入的主元素为
<span
class=
"redseed"
>
奇
</span>
|
<span
class=
"blueseed"
>
偶
</span>
数份时,元素会展
<br>
现
<span
class=
"redseed"
>
第一
</span>
|
<span
class=
"blueseed"
>
第二
</span>
个主特征。
<br>
<br>
<!--5级后解锁:最大生成效果调节-->
<!--{if $lvl>=5}-->
<span
class=
"yellow"
>
【节制】
</span><span
class=
"grey"
>
(勾选启用)
</span><input
type=
"checkbox"
id=
"change_emax"
name=
"change_emax"
value=
"-1"
><br>
› 你可以主动限制元素合成结果的
<span
class=
"lime"
>
效耐上限
</span>
。
<br>
› 当前:生成道具的效果+耐久上限
<span
class=
"yellow"
>
【
<span
id=
"s_emitme_max"
name=
"s_emitme_max"
>
$emax
</span>
】
</span><br>
<input
type=
"range"
class=
"range"
style=
"width:220px"
id=
"emitme_max_r"
name=
"emitme_max_r"
min=
"1"
max=
"100"
value=
"100"
onchange=
"getEmitmeR(1)"
><br>
<!-- 最大生成效果调节 -->
<span
class=
"yellow"
>
【节制】
</span><span
class=
"grey"
>
(勾选启用)
</span><input
type=
"checkbox"
id=
"change_emax"
name=
"change_emax"
value=
"0"
><br>
› 你可以主动限制元素合成结果的
<span
class=
"lime"
>
效耐上限
</span>
。
<br>
› 当前:生成道具的效果+耐久上限
<span
class=
"yellow"
>
【
<span
id=
"s_emitme_max"
name=
"s_emitme_max"
>
$emax
</span>
】
</span><br>
<input
type=
"range"
class=
"range"
style=
"width:220px"
id=
"emitme_max_r"
name=
"emixitmemax"
min=
"1"
max=
"100"
value=
"100"
onchange=
"getEmitmeR(1)"
><br>
<br>
<!--{else}-->
<span
class=
"grey"
>
【节制】(5级后解锁):
<br>
› 解锁后可以限制元素合成的
<span
class=
"lime"
>
效耐上限
</span>
。
<br></span>
<!-- 效果、耐久比例调节 -->
<span
class=
"yellow"
>
【预言】
</span><span
class=
"grey"
>
(勾选启用)
</span><input
type=
"checkbox"
id=
"change_emr"
name=
"change_emr"
value=
"0"
><br>
› 你能够干涉元素合成结果的
<span
class=
"lime"
>
效耐占比
</span>
。
<br>
› 当前:效果占比
<span
class=
"yellow"
>
【
<span
id=
"s_emitme_r"
name=
"s_emitme_r"
>
55
</span>
%】
</span>
耐久占比
<span
class=
"yellow"
>
【
<span
id=
"s_emitms_r"
name=
"s_emitms_r"
>
45
</span>
%】
</span><br>
<input
type=
"range"
class=
"range"
style=
"width:220px"
id=
"emitme_r"
name=
"emixitmer"
min=
"2"
max=
"98"
value=
"55"
onchange=
"getEmitmeR(0)"
><br>
<span
id=
"sr_warning"
name=
"sr_warning"
class=
"red"
></span>
<br>
<!--{/if}-->
<!--15级后解锁:效果、耐久比例调节-->
<!--{if $lvl>=15}-->
<span
class=
"yellow"
>
【预言】
</span><span
class=
"grey"
>
(勾选启用)
</span><input
type=
"checkbox"
id=
"change_emr"
name=
"change_emr"
value=
"-1"
><br>
› 你能够干涉元素合成结果的
<span
class=
"lime"
>
效耐占比
</span>
。
<br>
› 当前:效果占比
<span
class=
"yellow"
>
【
<span
id=
"s_emitme_r"
name=
"s_emitme_r"
>
55
</span>
%】
</span>
耐久占比
<span
class=
"yellow"
>
【
<span
id=
"s_emitms_r"
name=
"s_emitms_r"
>
45
</span>
%】
</span><br>
<input
type=
"range"
class=
"range"
style=
"width:220px"
id=
"emitme_r"
name=
"emitme_r"
min=
"2"
max=
"98"
value=
"55"
onchange=
"getEmitmeR(0)"
><br>
<span
id=
"sr_warning"
name=
"sr_warning"
class=
"red"
></span>
<br>
<!--{else}-->
<span
class=
"grey"
>
【预言】(15级后解锁):
<br>
› 解锁后能够干涉元素合成结果的
<span
class=
"lime"
>
效耐占比
</span>
。
<br>
› 当前:效果、耐久占比会在
<span
class=
"lime"
>
2%~98%
</span>
间浮动。
</span><br>
<br>
<!--{/if}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"zz"
name=
"submit"
value=
"[Z]提交"
onclick=
"$('command').value='elementmix';itemmixchooser();postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"zz"
name=
"submit"
value=
"[Z]提交"
onclick=
"itemmixchooser();$('command').value='elementmix';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"x"
name=
"submit"
value=
"[X]放弃"
onclick=
"postCmd('gamecmd','command.php');this.disabled=true;"
>
\ No newline at end of file
templates/default/help.htm
View file @
6bded008
...
...
@@ -1853,7 +1853,9 @@ NPC也会发出重击和必杀技,请随时小心。</p>
</td>
<td
class=
"b3"
>
<span>
可以通过打碎道具或尸体提炼元素,
<br>
并消耗元素来无中生有制造物品
</span>
并消耗元素来无中生有制造物品,
<br>
每次尝试制造物品时都能获得经验,只要结果不是特别糟糕……
</span>
</td>
<td
class=
"b3"
>
<span>
...
...
templates/default/itemdrop.htm
View file @
6bded008
你想丢掉什么?
<br><br>
<input
type=
"hidden"
name=
"mode"
value=
"itemmain"
>
<input
type=
"radio"
name=
"command"
id=
"menu"
value=
"menu"
checked
><a
onclick=
sl('menu');
href=
"javascript:void(0);"
>
返回
</a><br><br>
<input
type=
"radio"
name=
"command"
id=
"menu"
value=
"menu"
checked
><a
onclick=
sl('menu');
href=
"javascript:void(0);"
>
返回
</a>
<!--{if $club==20}-->
<input
type=
"checkbox"
id=
"split"
onchange=
"if($('split').checked){$('zz').value='[Z]确定并提炼';for (var i=1; i<=6; i++){ $('itm' + i).value = $('itm' + i).value.replace('dropitm','split_itm');}}else{$('zz').value='[Z]确定并丢弃';for(var i=1; i<=6; i++){$('itm' + i).value = $('itm' + i).value.replace('split_itm','dropitm');}}"
><a
onclick=
$('split').click();
href=
"javascript:void(0);"
>
提炼道具
</a>
<!--{/if}-->
<br><br>
<!--{if $itms1}-->
<input
type=
"radio"
name=
"command"
id=
"itm1"
value=
"dropitm1"
><a
onclick=
sl('itm1');
href=
"javascript:void(0);"
>
$itm1/$itme1/$itms1
</a><br>
<!--{/if}-->
...
...
templates/default/itemfind.htm
View file @
6bded008
...
...
@@ -7,7 +7,7 @@
<input
type=
"hidden"
id=
"command"
name=
"command"
value=
"itemget"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"zz"
name=
"itemget"
value=
"[Z]拾取"
onclick=
"postCmd('gamecmd','command.php');this.disabled=true;"
>
<!--{if $club==20}-->
<input
type=
"button"
id=
"
cc
"
class=
"cmdbutton"
name=
"split_itm"
value=
"[A]提炼"
onclick=
"$('command').value='split_itm0';postCmd('gamecmd','command.php');this.disabled=true;"
>
<input
type=
"button"
id=
"
aa
"
class=
"cmdbutton"
name=
"split_itm"
value=
"[A]提炼"
onclick=
"$('command').value='split_itm0';postCmd('gamecmd','command.php');this.disabled=true;"
>
<!--{/if}-->
<br><br>
<input
type=
"button"
class=
"cmdbutton"
id=
"xx"
name=
"dropitm0"
value=
"[X]丢弃"
onclick=
"$('command').value='dropitm0';postCmd('gamecmd','command.php');this.disabled=true;"
>
\ No newline at end of file
templates/default/itemmix_tips.htm
View file @
6bded008
<div
style=
"width:720px"
>
<div
class=
"b1"
style=
"height:20px"
><span>
合成笔记
</span></div>
<div
class=
"b3"
style=
"min-height:380px;display: flex;position:relative;justify-content: center;"
>
<div
style=
"min-width: 500px;max-width:700px;max-height:400px;text-align:left;word-break:break-all;overflow:auto;"
>
<!--{eval include_once GAME_ROOT.'./include/game/itemplace.func.php';$mixhint = init_itemmix_tips();}-->
<form
method=
"post"
id=
"maincmd"
name=
"maincmd"
>
<input
type=
"hidden"
name=
"itemindex"
id=
"itemindex"
value=
""
>
{$mixhint}
</form>
<!--{if $itemcmd == 'itemmix'}-->
<div
style=
"width:720px"
>
<div
class=
"b1"
style=
"height:20px"
><span>
合成笔记
</span></div>
<div
class=
"b3"
style=
"min-height:380px;display: flex;position:relative;justify-content: center;"
>
<div
style=
"min-width: 500px;max-width:700px;max-height:400px;text-align:left;word-break:break-all;overflow:auto;"
>
<!--{eval include_once GAME_ROOT.'./include/game/itemplace.func.php';$mixhint = init_itemmix_tips();}-->
<form
method=
"post"
id=
"maincmd"
name=
"maincmd"
>
<input
type=
"hidden"
name=
"itemindex"
id=
"itemindex"
value=
""
>
{$mixhint}
</form>
</div>
</div>
</div>
</div>
<!--{if !empty($itemindex)}-->
<!--{eval include_once GAME_ROOT.'./include/game/itemplace.func.php';$mixhint2 = init_itemmix_tips($itemindex);}-->
<dialog
id=
"itemmix_tips"
style=
"min-width: fit-content; min-height: fit-content;max-width: 400px;max-height: 600px;"
>
<div
id=
"tipsinfo"
>
<div
class=
"b3"
style=
"mdisplay: flex;position:relative;justify-content: center;"
>
<div
style=
"text-align:left;word-break:break-all;overflow:auto;"
>
{$mixhint2}
<!--{if !empty($itemindex)}-->
<!--{eval include_once GAME_ROOT.'./include/game/itemplace.func.php';$mixhint2 = init_itemmix_tips($itemindex);}-->
<dialog
id=
"itemmix_tips"
style=
"min-width: fit-content; min-height: fit-content;max-width: 400px;max-height: 600px;"
>
<div
id=
"tipsinfo"
>
<div
class=
"b3"
style=
"mdisplay: flex;position:relative;justify-content: center;"
>
<div
style=
"text-align:left;word-break:break-all;overflow:auto;"
>
{$mixhint2}
</div>
</div>
</div>
<img
class=
"dialog-background"
src=
"img/profile.gif"
onclick=
"closeDialog($('itemmix_tips'));this.disabled=true;"
>
</dialog>
<!--{/if}-->
<!--{elseif $itemcmd == 'elementmix'}-->
<style>
table
.infotable
{
float
:
left
;
margin-top
:
10px
;
position
:
relative
;
text-align
:
center
;
border-radius
:
3px
;
border
:
2px
solid
rgba
(
225
,
124
,
226
,
0.25
);
}
table
.infotable
td
,
table
.infotable
th
{
width
:
55px
;
text-align
:
center
;
border
:
1px
solid
rgba
(
225
,
124
,
226
,
0.4
);
}
</style>
<div
style=
"width:740px"
>
<div
class=
"b1"
style=
"height:20px"
><span>
元素笔记
</span></div>
<div
class=
"b3"
style=
"min-height:380px;display: flex;position:relative;justify-content: center;"
>
<div
style=
"min-width: 500px;max-width:720px;max-height:400px;text-align:left;word-break:break-all;overflow:auto;"
>
<!--{eval include_once GAME_ROOT.'./include/game/elementmix.func.php';$smhint = emix_init_elements_info($pdata);}-->
<!--{loop Array('element0','element1','element2','element3','element4','element5') $ekey $enum}-->
<table
cellspacing=
"0"
cellpadding=
"0"
class=
"infotable"
>
<tr>
<TD
colspan=
"2"
class=
"b1"
style=
"width: 110px; height: 24px;"
>
{$elements_info[$ekey]}
</TD>
</tr>
<tr
class=
"map"
height=
"28"
>
<td
colspan=
"2"
>
<span
class=
""
>
{$pdata[$enum]}
</span>
份
</td>
</tr>
<tr
class=
"map"
height=
"24"
>
<td
colspan=
"2"
>
<!--{eval $domdesc_0 = emix_init_elements_tags($ekey,'dom',0,$pdata)}-->
{$domdesc_0}
</td>
</tr>
<tr
class=
"map"
height=
"24"
>
<td
colspan=
"2"
>
<!--{eval $domdesc_1 = emix_init_elements_tags($ekey,'dom',1,$pdata)}-->
{$domdesc_1}
</td>
</tr>
<tr
class=
"map"
height=
"24"
>
<td>
<!--{eval $subdesc_0 = emix_init_elements_tags($ekey,'sub',0,$pdata)}-->
{$subdesc_0}
</td>
<td>
<!--{eval $subdesc_1 = emix_init_elements_tags($ekey,'sub',1,$pdata)}-->
{$subdesc_1}
</td>
</tr>
<tr
class=
"map"
height=
"24"
>
<td>
<!--{eval $subdesc_2 = emix_init_elements_tags($ekey,'sub',2,$pdata)}-->
{$subdesc_2}
</td>
<td>
<!--{eval $subdesc_3 = emix_init_elements_tags($ekey,'sub',3,$pdata)}-->
{$subdesc_3}
</td>
</tr>
</table>
<!--{/loop}-->
<br>
<hr
style=
"clear:both; border: 1px solid rgba(225, 124, 226, 0.25);"
>
<div
style=
"display: block;word-break:break-all;overflow:auto;"
>
{$smhint}
</div>
</div>
</div>
</div>
<img
class=
"dialog-background"
src=
"img/profile.gif"
onclick=
"closeDialog($('itemmix_tips'));this.disabled=true;"
>
</dialog>
<!--{/if}-->
\ 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