Commit c2d92cc5 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #45 from hikawiier/waaagh

rev combat phase 3.15
parents 46813c28 c04d78e4
......@@ -145,7 +145,7 @@ if($hp > 0 && !empty($clbpara['lasttimes']))
init_profile();
}
}
if($hp > 0 && in_array('inf_dizzy',$clbpara['skill']))
if($hp > 0 && !empty($clbpara['skill']) && in_array('inf_dizzy',$clbpara['skill']))
{
$dizzy_times = (($clbpara['starttimes']['inf_dizzy'] + $clbpara['lasttimes']['inf_dizzy']) - $now)*1000;
$log .= '<span class="yellow">你现在处于眩晕状态,什么都做不了!</span><br>眩晕状态持续时间还剩:<span id="timer" class="yellow">'.$dizzy_times.'.0</span>秒<br><script type="text/javascript">demiSecTimerStarter('.$dizzy_times.');</script>';
......
......@@ -7,7 +7,7 @@ if(!defined('IN_GAME')) exit('Access Denied');
$club_skillslist = Array
(
1 => Array('s_hp','s_ad','f_heal','c1_def','c1_crit','c1_sneak','c1_burnsp','c1_bjack','c1_veteran'), #'铁拳无敌',
2 => Array('s_hp','s_ad','f_heal'), #'见敌必斩',
2 => Array('s_hp','s_ad','f_heal','c2_butcher','c2_intuit','c2_raiding','c2_master','c2_annihil'), #'见敌必斩',
3 => Array('s_hp','s_ad','f_heal'), #'灌篮高手',
4 => Array('s_hp','s_ad','f_heal'), #'狙击鹰眼',
5 => Array('s_hp','s_ad','f_heal'), #'拆弹专家',
......@@ -47,6 +47,17 @@ $cskills_wlist = Array
);
# 社团技能标签介绍:
$cskills_tags = Array
(
'battle' => '<span tooltip="可以在战斗中主动使用" class="gold">【战斗技】</span>',
'passive' => '<span tooltip="满足条件时自动触发" class="gold">【被动技】</span>',
'active' => '<span tooltip="需主动启用才能产生效果" class="gold">【主动技】</span>',
//'cd' => '<span tooltip="隐藏标签:有此标签的技能会在载入时检查是否处于冷却状态" class="gold">【冷却技】</span>',
'openning' => '<span tooltip="仅在先制发现敌人时可用" class="gold">【开幕技】</span>',
//'buff' => '<span tooltip="隐藏标签:代表这是一个临时性状态" class="gold">【状态】</span>',
);
# 技能登记:
$cskills = Array
(
......@@ -54,38 +65,29 @@ $cskills = Array
/*'技能编号' => Array
(
'name' => '技能名', //(必填)技能名
'tags' => Array('battle','active','passive','inf','hidden'), //(非必填)定义一个技能带有的标签
// battle: 战斗技,会显示在战斗指令界面;
// active: 战斗技,但不能在追击/鏖战中使用;
// passive: 被动技能,在战斗中会自动判断是否生效;
// inf: 状态技能,在战斗中会自动判断是否生效。和被动技的区别暂时还没有……;
// hidden:隐藏技能,不会在面板中显示。暂时没有实现
'maxlvl' => 0, //(非必填)定义一个技能为可升级技能,并定义该技能的等级上限。注意:带有等级上限的技能如果设置了'cost','cost'的值必须是一个数组,对应每等级升级时需消耗的技能点
'tags' => Array(), //(非必填)定义一个技能带有的标签
'desc' => '', //(非必填)技能介绍,显示在技能面板上,可以使用[: :]设置一些静态参数,会在生成时自动替换对应参数。
// [:cost:]:消耗的技能点
// [:effect:]:增加指定属性
// [:effect:]att :增加对应属性,可以将att替换为'effect'内定义过的键名
// [::]:还可以替换为任意'vars'内定义过的键名
'lockdesc' => '', //(需解锁技能必填)不满足解锁条件时的介绍
'bdesc' => '', //(战斗技必填)显示在战斗界面上的短介绍,战斗技必填
'log' => '', //(可升级/操作技能必填)升级/操作技能后显示的提示文本
'maxlvl' => 0, //(非必填)定义一个技能为可升级技能,并定义该技能的等级上限。注意:带有等级上限的技能如果设置了'cost','cost'的值必须是一个数组,对应每等级升级时需消耗的技能点
'cost' => 1, //(可升级/操作技能必填)升级/操作技能要花费的技能点,如果设置过'maxlvl',这里应该设置成一个Array
'input' => '升级',//(可升级/操作技能必填)自动生成模板时,对应操作按钮的名字,不存在时不会生成按钮
'num_input' => 1,//(非必填)自动生成模板时,是否会为其生成数字输入框(便于快速提交多次升级)
'log' => '', //(可升级/操作技能必填)升级/操作技能后显示的提示文本
'status' => Array('hp','mhp'),//(非必填)每次升级时,直接提升的玩家属性。
// 和头衔入场奖励类似,支持所有在数据库中登记过的字段名
// 如果输入了Array('para' => Array('lvl')),代表升级时会提升该技能的等级
'effect' => Array(0 => Array('att' => 4, 'def' => 6),13 => Array('att' => 9, 'def' => 12),),//(非必填)每次升级时,直接提升的玩家属性对应的值。
// 键名为 0 时,代表默认情况下会增加的对应属性值。键值可以是一个由字段名构成的数组。也可以只是一个数字——代表会增加所有'status'中登记的属性值
// 键名为 其他数字 时,代表该数字对应【社团】会增加的属性值
'events' => Array(''); //(非必填)每次升级时会触发的事件,目前只有一个'heal',代表全恢复
'unlock' => Array('lvl' => '[:lvl:] >= 3',), //(非必填)技能解锁条件,键名和键值[::]内的内容要相同。键值须为PHP支持的条件判断语句。支持“或”类型判断,请参考下方例子。
// Array('wepk+wep_kind' => "[:wepk:] == 'WP' || [:wep_kind:] == 'P'",), 键名中的+是分隔符,处理时会依此将条件分割为数组,替换键值内的判断语句
'link' => Array(), //(非必填)技能的关联对象:技能在生成介绍模板时,会同时从关联对象中获取静态参数
'vars' => Array(), //(非必填)技能内预设的静态参数,比如'ragecost'怒气消耗。预设的参数可以自动填充'desc'中对应[::]的内容
'svars' => Array(), //(非必填)初次获得技能时,保存在clbpara['skillpara']['技能编号']中的动态技能参数。可以用来定义技能的使用次数等。
'slast' => Array('lasttimes' => 0,'lastturns' => 0,), //(非必填)初次获得时效性技能时,保存在clbpara内的数据。暂时只支持以下参数:
......@@ -93,16 +95,18 @@ $cskills = Array
// 'lastturns' => 0, 代表技能持续的回合,保存在clbpara['lastturns']['技能编号']中
// 时效性技能才初次霍德师,还会获得一个等于当前时间戳的'starttimes',保存在clbpara['starttimes']['技能编号']中
// 玩家在行动时会判断时效性技能是否结束,NPC敌人在被玩家发现时会判断时效性技能是否结束,并在战斗开始前保存状态
'lockdesc' => '', //(需解锁技能必填)不满足解锁条件时的介绍
'unlock' => Array('lvl' => '[:lvl:] >= 3',), //(非必填)技能解锁条件,键名和键值[::]内的内容要相同。键值须为PHP支持的条件判断语句。支持“或”类型判断,请参考下方例子。
// Array('wepk+wep_kind' => "[:wepk:] == 'WP' || [:wep_kind:] == 'P'",), 键名中的+是分隔符,处理时会依此将条件分割为数组,替换键值内的判断语句
),*/
's_hp' => Array
(
'name' => '生命',
'desc' => '每消耗<span class="lime">[:cost:]</span>技能点,生命上限<span class="yellow">+[:effect:]</span>点',
'log' => '消耗了<span class="lime">[:cost:]</span>点技能点,你的生命上限增加了<span class="yellow">[:effect:]</span>点。<br>',
'cost' => 1,
'input' => '升级',
'num_input' => 1,
'log' => '消耗了<span class="lime">[:cost:]</span>点技能点,你的生命上限增加了<span class="yellow">[:effect:]</span>点。<br>',
'status' => Array('hp','mhp'),
'effect' => Array(
0 => 3, # 默认每消耗cost点技能点可增加3点生命值与最大生命值
......@@ -113,10 +117,10 @@ $cskills = Array
(
'name' => '攻防',
'desc' => '每消耗<span class="lime">[:cost:]</span>技能点,基础攻击<span class="yellow">+[:effect:]att</span>点,基础防御<span class="yellow">+[:effect:]def</span>点',
'log' => '消耗了<span class="lime">[:cost:]</span>点技能点,你的基础攻击增加了<span class="yellow">[:effect:]att</span>点,基础防御增加了<span class="yellow">[:effect:]def</span>点。<br>',
'cost' => 1,
'input' => '升级',
'num_input' => 1,
'log' => '消耗了<span class="lime">[:cost:]</span>点技能点,你的基础攻击增加了<span class="yellow">[:effect:]att</span>点,基础防御增加了<span class="yellow">[:effect:]def</span>点。<br>',
'status' => Array('att','def'),
'effect' => Array(
0 => Array('att' => 4, 'def' => 6),
......@@ -127,9 +131,9 @@ $cskills = Array
(
'name' => '自愈',
'desc' => '消耗<span class="lime">[:cost:]</span>技能点,解除全部受伤与异常状态,并完全恢复生命与体力',
'log' => '消耗了<span class="lime">[:cost:]</span>技能点。<br>',
'cost' => 1,
'input' => '治疗',
'log' => '消耗了<span class="lime">[:cost:]</span>技能点。<br>',
'events' => Array('heal'),
),
'c1_def' => Array
......@@ -137,12 +141,11 @@ $cskills = Array
'name' => '格挡',
'tags' => Array('passive'),
'desc' => '持殴系武器时,武器效果值的<span class="yellow">[:trans:]%</span>计入防御力(最多[:maxtrans:]点)<br>',
'lockdesc' => '武器不适用,持<span class="yellow">殴系武器</span>时生效',
'log' => '<br>',
'vars' => Array(
'trans' => 40, //效&防转化率
'maxtrans' => 2000, //转化上限
),
'lockdesc' => '武器不适用,持<span class="yellow">殴系武器</span>时生效',
'unlock' => Array(
'wepk+wep_kind' => "[:wepk:] == 'WP' || [:wepk:] == 'WCP' || [:wepk:] == 'WKP' || [:wep_kind:] == 'P'",
),
......@@ -151,25 +154,25 @@ $cskills = Array
(
'name' => '猛击',
'tags' => Array('passive'),
'maxlvl' => 2,
'desc' => '持殴系武器战斗时<span class="yellow">[:rate:]%</span>几率触发,触发则物理伤害增加<span class="yellow">[:attgain:]%</span>,<br>
且晕眩敌人<span class="cyan">[:stuntime:]</span>秒。晕眩状态下敌人无法进行任何行动或战斗。<br></span>',
'lockdesc' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
'log' => '升级成功。<br>',
'maxlvl' => 2,
'cost' => Array(10,11,-1),
'input' => '升级',
'log' => '升级成功。<br>',
'status' => Array('para' => Array('lvl')),
'effect' => Array(
0 => Array('lvl' => 1),
),
'svars' => Array(
'lvl' => 0, //初次获得时等级为0
),
'vars' => Array(
'attgain' => Array(20,50,80), //物理伤害增加
'stuntime' => Array(1,1,2), //晕眩时间(单位:秒)
'rate' => 25, //触发率
),
'svars' => Array(
'lvl' => 0, //初次获得时等级为0
),
'lockdesc' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
'unlock' => Array(
'wepk+wep_kind' => "[:wepk:] == 'WP' || [:wepk:] == 'WCP' || [:wepk:] == 'WKP' || [:wep_kind:] == 'P'",
),
......@@ -177,18 +180,17 @@ $cskills = Array
'c1_sneak' => Array
(
'name' => '偷袭',
'tags' => Array('battle','active'),
'tags' => Array('battle','opening'),
'desc' => '本次攻击必定触发技能“<span class="yellow">猛击</span>”且不会被反击。<br>
持殴系武器方可发动,发动消耗<span class="yellow">[:ragecost:]</span>点怒气。<br>',
'bdesc' => '必定触发技能“<span class="yellow">猛击</span>”且不会被反击。消耗<span class="red">[:ragecost:]</span>怒气',
'vars' => Array(
'ragecost' => 25, //消耗怒气
),
'lockdesc' => Array(
'lvl' => '3级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
),
'log' => '<br>',
'vars' => Array(
'ragecost' => 25, //消耗怒气
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 3',
'wepk+wep_kind' => "[:wepk:] == 'WP' || [:wepk:] == 'WCP' || [:wepk:] == 'WKP' || [:wep_kind:] == 'P'",
......@@ -200,16 +202,15 @@ $cskills = Array
'tags' => Array('passive'),
'desc' => '持殴系武器攻击后敌人体力减少<span class="yellow">伤害值的[:burnspr:]%</span>点<br>
被攻击时你额外获得<span class="yellow">[:mingrg:]~[:maxgrg:]点</span>怒气',
'lockdesc' => Array(
'lvl' => '6级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
),
'log' => '<br>',
'vars' => Array(
'burnspr' => 33, //体力减少&伤害占比
'mingrg' => 1, //最小怒气增益
'maxgrg' => 2, //最大怒气增益
),
'lockdesc' => Array(
'lvl' => '6级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 6',
'wepk+wep_kind' => "[:wepk:] == 'WP' || [:wepk:] == 'WCP' || [:wepk:] == 'WKP' || [:wep_kind:] == 'P'",
......@@ -223,14 +224,13 @@ $cskills = Array
并对敌人额外造成(<span class="yellow">敌方体力上限减当前体力</span>)点的最终伤害。<br>
持钝器方可发动,发动消耗<span class="yellow">[:ragecost:]</span>点怒气。',
'bdesc' => '必定触发技能“<span class="yellow">猛击</span>”,并附加(<span class="yellow">敌方体力上限减当前体力</span>)点伤害。消耗<span class="red">[:ragecost:]</span>怒气',
'vars' => Array(
'ragecost' => 85, //消耗怒气
),
'lockdesc' => Array(
'lvl' => '11级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">殴系武器</span>时可发动',
),
'log' => '<br>',
'vars' => Array(
'ragecost' => 85, //消耗怒气
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 11',
'wepk+wep_kind' => "[:wepk:] == 'WP' || [:wepk:] == 'WCP' || [:wepk:] == 'WKP' || [:wep_kind:] == 'P'",
......@@ -251,13 +251,153 @@ $cskills = Array
'lvl' => '[:lvl:] >= 18',
),
),
'c2_butcher' => Array
(
'name' => '解牛',
'tags' => Array('battle'),
'desc' => '本次攻击附加<span class="yellow">([:fixdmg:]+[^lvl^])</span>点的最终伤害,且武器损耗率减半。<br>
持斩系武器方可发动,消耗<span class="yellow">[:ragecost:]</span>点怒气',
'bdesc' => '本次攻击附加<span class="yellow">[:fixdmg:]+[^lvl^]</span>点伤害,且武器损耗率减半,消耗<span class="red">[:ragecost:]</span>怒气',
'vars' => Array(
'ragecost' => 5,
'fixdmg' => 30, //基础固定伤害
'wepimpr' => 0.5, //武器损耗率
),
'pvars' => Array('lvl'),
'lockdesc' => '武器不适用,持<span class="yellow">斩系武器</span>时可发动',
'unlock' => Array(
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
),
),
'c2_intuit' => Array
(
'name' => '直感',
'tags' => Array('passive'),
'desc' => '持斩系武器时,你的命中率<span class="yellow">+[:accgain:]%</span>,反击率<span class="yellow">+[:countergain:]%</span>,<br>
连击命中率惩罚降低<span class="yellow">[:rbgain:]%</span>,武器伤害浮动范围<span class="yellow">+[:flucgain:]%</span>,<br>
有<span class="yellow">[:rangerate:]%</span>概率允许超射程反击(爆系除外)<br>',
'maxlvl' => 6,
'cost' => Array(4,4,4,4,5,5,-1),
'input' => '升级',
'log' => '升级成功。<br>',
'status' => Array('para' => Array('lvl')),
'effect' => Array(
0 => Array('lvl' => 1),
),
'svars' => Array(
'lvl' => 0, //初次获得时等级为0
),
'vars' => Array(
'accgain' => Array(0,2,4,6,8,11,14), //命中增益
'rbgain' => Array(0,2,4,6,8,10,12), //连击命中惩罚降低
'flucgain' => Array(0,5,10,15,20,25,30), //伤害浮动修正
'rangerate' => Array(0,20,40,60,80,100,100), //超射程反击率
'countergain' => Array(0,2,3,4,10,12,30), //基础反击率
),
'lockdesc' => '武器不适用,持<span class="yellow">斩系武器</span>时生效',
'unlock' => Array(
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
),
),
'c2_raiding' => Array
(
'name' => '强袭',
'tags' => Array('battle'),
'desc' => '本次攻击无视减半类防御属性,最终伤害<span class="yellow">+[:findmgr:]%</span>',
'bdesc' => '本次攻击攻击最终伤害<span class="yellow">+[:findmgr:]%</span>,无视敌方减半类防御属性;消耗<span class="red">[:ragecost:]</span>怒气',
'vars' => Array(
'ragecost' => 70,
'findmgr' => 40, //最终伤害加成
),
'lockdesc' => Array(
'lvl' => '15级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">斩系武器</span>时可发动',
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 15',
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
),
),
'c2_master' => Array
(
'name' => '舞钢',
'tags' => Array('passive'),
'desc' => '使用斩系武器时,你的武器伤害浮动不会出现负值。',
'lockdesc' => Array(
'lvl' => '15级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">斩系武器</span>时生效',
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 15',
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
),
),
'c2_annihil' => Array
(
'name' => '歼灭',
'tags' => Array('active','cd'),
'desc' => '发动后获得增益效果:<br>
持斩系武器时,你的攻击有<span class="yellow">[:rate:]%</span>概率造成<span class="red b">[:findmgr:]%</span>最终伤害;<br>
计算属性伤害时你的基础攻击力将视作武器攻击力。<br>
增益效果持续时间<span class="yellow">[:lasttimes:]</span>秒,冷却时间<span class="clan">[:cd:]</span>秒。<br>',
'input' => '发动',
'log' => '<span class="lime">技能「歼灭」发动成功。</span><br>',
'status' => Array('para' => Array('active')),
'effect' => Array(
0 => Array('active' => 1),
),
'events' => Array('setstarttimes_c2_annihil','getskill_buff_annihil'),
'link' => Array('buff_annihil'),
'vars' => Array(
'lasttimes' => 200, //持续时间 仅供介绍文本显示用
'cd' => 900, //冷却时间
),
'svars' => Array(
'active' => 0,
),
'lockdesc' => Array(
'lvl' => '21级时解锁',
'wepk+wep_kind' => '武器不适用,持<span class="yellow">斩系武器</span>时可发动',
'skillpara-active' => '技能发动中!',
'skillcooldown' => '技能冷却中!<br>剩余冷却时间:<span class="red">[:cd:]</span> 秒',
),
'unlock' => Array(
'lvl' => '[:lvl:] >= 21',
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
'skillpara-active' => '[:active:] <= 0',
'skillcooldown' => 0,
),
),
'buff_annihil' => Array
(
'name' => '歼灭',
'tags' => Array('buff'),
'desc' => '<span class="lime">「歼灭」生效中!<br>
增益效果剩余时间:<span class="yellow">[^lasttimes^]</span> 秒</span>',
'vars' => Array(
'rate' => 20, //发动概率
'findmgr' => 200, //最终伤害加成
),
'slast' => Array(
'lasttimes' => 200, //真正作用的持续时间
),
'pvars' => Array('lasttimes'),
'lostevents' => Array('unactive_c2_annihil'),
'lockdesc' => Array(
'wepk+wep_kind' => '武器不适用,持<span class="yellow">斩系武器</span>时生效',
),
'unlock' => Array(
'wepk+wep_kind' => "[:wepk:] == 'WK' || [:wepk:] == 'WGK' || [:wepk:] == 'WKP' || [:wepk:] == 'WKF' || [:wepk:] == 'WFK' || [:wep_kind:] == 'K'",
),
),
'inf_dizzy' => Array
(
'name' => '眩晕',
'tags' => Array('inf'),
'desc' => '你感到头晕目眩,无法进行任何行动或战斗!<br>眩晕状态持续时间还剩<span class="red">[:lasttimes:]</span>秒',
'desc' => '你感到头晕目眩,无法进行任何行动或战斗!<br>眩晕状态持续时间还剩<span class="red">[^lasttimes^]</span>秒',
'pvars' => Array('lasttimes'),
'slast' => Array(
'lasttimes' => 0, //技能的持续时间由其他因素决定 这里仅留作占位
'lasttimes' => 0, //真正作用的持续时间
),
),
);
......
......@@ -10,10 +10,10 @@ CREATE TABLE bra_log (
type char(1) NOT NULL default '',
prcsd tinyint(1) unsigned NOT NULL default 0,
`time` int(10) unsigned NOT NULL default '0',
`log` varchar(255) NOT NULL default '',
`log` text NOT NULL default '',
PRIMARY KEY (lid)
) ENGINE=HEAP;
) ENGINE=MyISAM;
--
-- 表的结构 `bra_chat`
......@@ -77,7 +77,7 @@ DROP TABLE IF EXISTS bra_newsinfo;
CREATE TABLE bra_newsinfo (
nid smallint unsigned NOT NULL auto_increment,
`time` int(10) unsigned NOT NULL default '0',
`news` char(15) NOT NULL default '',
`news` char(30) NOT NULL default '',
`a` varchar(255) NOT NULL default '',
`b` varchar(255) NOT NULL default '',
`c` varchar(255) NOT NULL default '',
......
......@@ -602,7 +602,12 @@ EOT;
$unlock_flag = check_skill_unlock($sk,$data);
if($unlock_flag)
{
if(is_array($unlock_flag))
{
$unlock_cd = $unlock_flag[1]; $unlock_flag = $unlock_flag[0];
}
$unlock_flag = is_array($cskill['lockdesc']) ? $cskill['lockdesc'][$unlock_flag] : $cskill['lockdesc'];
if(isset($unlock_cd)) $unlock_flag = str_replace("[:cd:]","$unlock_cd",$unlock_flag);
$sk_temp .= <<<EOT
<div style="position:relative; height:100%; width:100%;" onmouseover="skill_unacquired_mouseover.call(this,event)" onmouseout="skill_unacquired_mouseout.call(this,event)">
<div class="skill_unacquired">
......@@ -676,7 +681,7 @@ function get_remaincdtime($pid){
function check_skilllasttimes(&$data=NULL)
{
global $cskills,$log,$now,$name;
if(empty($data))
if(!isset($data))
{
global $clbpara;
$para = &$clbpara;
......@@ -687,23 +692,31 @@ function check_skilllasttimes(&$data=NULL)
$para = &$data['clbpara'];
$nm = &$data['name'];
}
$pure_flag = 0;
if(!empty($para['lasttimes']))
{
include_once GAME_ROOT.'./include/game/revclubskills.func.php';
foreach($para['lasttimes'] as $sk => $lts)
{
$stm = isset($para['starttimes'][$sk]) ? $para['starttimes'][$sk] : 0;
# 技能已达到时效,失去该技能,并清空相关内容
# 技能已达到时效
if($now > $lts+$stm)
{
lostclubskill($sk,$para);
$sk_name = $cskills[$sk]['name'];
$log.="<span class='yellow'>{$nm}{$sk_name}状态中恢复了!</span><br>";
return 1;
if(get_skilltags($sk,'buff'))
{
$log.="技能<span class='yellow'>「{$sk_name}」</span>的持续效果结束了!<br>";
}
else
{
$log.="{$nm}从<span class='yellow'>「{$sk_name}」</span>状态中恢复了!<br>";
}
lostclubskill($sk,$para);
$pure_flag = 1;
}
}
}
return;
return $pure_flag;
}
//通过pid抓取指定玩家/NPC数据
......
......@@ -54,7 +54,7 @@ function getclub($who, &$c1, &$c2, &$c3)
function changeclub($clb,&$data=NULL)
{
if(empty($data))
if(!isset($data))
{
global $club;
lostclub();
......@@ -104,7 +104,7 @@ function lostclub(&$data=NULL)
if(!$club) return 0;
# 丢失原社团时 注销社团技能
include_once GAME_ROOT.'./include/game/revclubskills.func.php';
if(empty($data))
if(!isset($data))
{
$cks = $club_skillslist[$club];
foreach($cks as $sk) lostclubskill($sk,$clbpara);
......
......@@ -122,7 +122,7 @@
# 百战技能特效
if(isset($pa['skill_c1_veteran']))
{
$sk_def = get_skillpara('c1_veteran','choice',$pa);
$sk_def = get_skillpara('c1_veteran','choice',$pa['clbpara']);
if($sk_def)
{
global $itemspkinfo;
......@@ -276,6 +276,8 @@
$hitrate = min($hitrate_max_obbs[$pa['wep_kind']],$hitrate);
//获取社团技能对基础命中率的修正
$hitrate *= rev_get_clubskill_bonus_hitrate($pa['club'],$pa['skills'],$pa,$pd['club'],$pd['skills'],$pd);
//获取社团技能对基础命中率的修正(新)
$hitrate *= get_clbskill_hitrate($pa,$pd,$active,$hitrate);
//异常状态状态修正
foreach ($inf_htr_p as $inf_ky => $value)
{
......@@ -296,6 +298,8 @@
$hitratebonus = 0.8;
//获取社团技能对连击命中率衰减系数的修正
$hitratebonus *= rev_get_clubskill_bonus_hitrate($pa['club'],$pa['skills'],$pa,$pd['club'],$pd['skills'],$pd);
//获取社团技能对连击命中率衰减系数的修正(新)
$hitratebonus *= get_clbskill_r_hitrate($pa,$pd,$active,$hitratebonus);
//获取基础致伤率(防具耐久损伤率)系数
$inf_r = $infobbs[$pa['wep_kind']];
......@@ -316,6 +320,12 @@
if($pa['weps']==$nosta) $wep_imp_obbs *= 2;
//社团技能对武器损伤系数的修正
$wep_imp_obbs *= rev_get_clubskill_bonus_imprate($pa['club'],$pa['skills'],$pa,$pd['club'],$pd['skills'],$pd);
//社团技能对武器损伤系数的修正(新)
# 「解牛」技能效果:
if(isset($pa['skill_c2_butcher']))
{
$wep_imp_obbs *= get_skillvars('c2_butcher','wepimpr');
}
}
else
{
......@@ -689,8 +699,14 @@
$dfluc = $dmg_fluc [$pa['wep_kind']];
//获取社团技能对伤害浮动系数的修正:
$dfluc += rev_get_clubskill_bonus_fluc($pa['club'],$pa['skills'],$pa,$pd['club'],$pa['skills'],$pd);
//计算伤害浮动:
$dmg_factor = (100 + rand ( - $dfluc, $dfluc )) / 100;
//获取社团技能对伤害浮动系数的修正(新):
$dfluc += get_clbskill_fluc($pa,$pd,$active);
//计算具体伤害浮动:
$dfluc = rand(-$dfluc,$dfluc);
//「舞钢」效果判定:
if(isset($pa['skill_c2_intuit']) && $dfluc < 0) $dfluc = abs($dfluc);
//汇总
$dmg_factor = (100 + $dfluc) / 100;
$damage = round ( $damage * $dmg_factor * rand ( 4, 10 ) / 10 );
//把计算得到的原始伤害保存在$pa['original_dmg']里
$pa['original_dmg'] = $damage;
......@@ -899,6 +915,14 @@
$pa['pierce_flag'] = 1;
}
}
# 「强袭」效果判定:
if(isset($pa['skill_c2_raiding']) && isset($pd['phy_def_flag']) && $pd['phy_def_flag'] != 2)
{
$pd['phy_def_flag'] = 0;
$log .= "{$pa['nm']}的攻击无视了{$pd['nm']}的伤害减半效果!<br>";
}
return;
}
......@@ -1069,6 +1093,14 @@
$pa['ex_pierce_flag'] = 1;
}
}
# 「强袭」效果判定:
if(isset($pa['skill_c2_raiding']) && isset($pd['ex_def_flag']) && $pd['ex_def_flag'] != 2)
{
$pd['ex_def_flag'] = 0;
$log .= "{$pa['nm']}的攻击无视了{$pd['nm']}的属性伤害减半效果!<br>";
}
return;
}
......@@ -1096,6 +1128,8 @@
$dmginf = '';
//计算单个属性的基础属性伤害: 基础伤害 + 效果↔伤害系数修正 + 熟练↔伤害系数修正
$ex_dmg = $ex_base_dmg[$ex] + $pa['wepe']/$ex_wep_dmg[$ex] + $pa['wep_skill']/$ex_skill_dmg[$ex];
//计算社团技能对单个属性基础伤害的补正
$ex_dmg += get_clbskill_ex_base_dmg_fix($pa,$pd,$active,$ex);
//计算单个属性能造成的基础伤害上限
if($ex_max_dmg[$ex]>0 && $ex_dmg>$ex_max_dmg[$ex]) $ex_dmg = $ex_max_dmg[$ex];
......@@ -1153,6 +1187,30 @@
global $log;
$fin_dmg_p = Array();
# 「强袭」效果判定:
if(isset($pa['skill_c2_raiding']))
{
$sk_p = get_skillvars('c2_raiding','findmgr');
$p = 1+($sk_p / 100);
$log.= "<span class='yellow'>「强袭」使{$pa['nm']}造成的最终伤害提高了{$sk_p}%!</span><br>";
$fin_dmg_p[] = $p;
}
# 「歼灭」效果判定:
if(isset($pa['skill_buff_annihil']))
{
# 「歼灭」有两段效果,一段为概率触发,一段为固定触发,所以只在概率触发的位置判定概率。
$sk_dice = diceroll(99);
$sk_obbs = get_skillvars('buff_annihil','rate');
if($sk_dice < $sk_obbs)
{
$sk_p = get_skillvars('buff_annihil','findmgr');
$p = $sk_p / 100;
$log.= "<span class='red'>暴击!</span><span class='lime'>「歼灭」使{$pa['nm']}造成的最终伤害提高了{$sk_p}%!</span><br>";
$fin_dmg_p[] = $p;
}
}
# 书中虫防守事件:移动到最终伤害系数变化阶段了
if($pd['type'] == 89 && ($pd['name'] == '高中生·白神' || $pd['name'] == '白神·讨价还价'))
{
......@@ -1193,6 +1251,13 @@
$log.="闷棍没有造成额外伤害!<br>";
}
}
# 「解牛」技能效果:
if(isset($pa['skill_c2_butcher']))
{
$sk_dmg = get_skillvars('c2_butcher','fixdmg') + $pa['lvl'];
$log.='<span class="yellow">「解牛」附加了'.$sk_dmg.'点伤害!</span><br>';
$fin_dmg += $sk_dmg;
}
# 伤害制御判定:
if(in_array('h',$pd['ex_keys']) && $fin_dmg>=1950)
......@@ -1281,11 +1346,11 @@
global $now;
if(!$pd['type'] && $pd['nm']!='你')
{
$pd['logsave'] .= "并且{$pa['nm']}凶猛的一击直接将你打晕了过去!<br>";
$pd['logsave'] .= "凶猛的一击直接将你打晕了过去!<br>";
}
elseif(!$pa['type'] && $pa['nm']!='你')
{
$pa['logsave'] .= "你凶猛的一击直接将{$pd['nm']}打晕了过去!</span><br>";
$pa['logsave'] .= "你凶猛的一击直接将<span class=\"yellow\">{$pd['name']}}</span>打晕了过去!<br>";
}
}
......@@ -1440,8 +1505,14 @@
$pd['cannot_counter_log'] = "{$pd['nm']}看起来非常生气!还是离他远点吧……";
return 0;
}
# 被「偷袭」技能攻击、或正处于眩晕状态时,无法反击
if(isset($pa['skill_c1_sneak']) || isset($pd['skill_inf_dizzy']))
# 被偷袭无法反击
if(isset($pa['skill_c1_sneak']))
{
$pd['cannot_counter_log'] = "{$pd['nm']}无法反击!";
return 0;
}
# 处于眩晕状态时,无法反击
if(isset($pd['skill_inf_dizzy']))
{
$pd['cannot_counter_log'] = "{$pd['nm']}正处于眩晕状态,无法反击!";
return 0;
......@@ -1455,6 +1526,17 @@
if(!empty($pa['wep_range']) && $pd['wep_range'] >= $pa['wep_range']) return 1;
# 鏖战状态下无视射程反击(爆系武器除外)
if((isset($pd['is_dfight']) || isset($pa['is_dfight'])) && !empty($pd['wep_range'])) return 1;
#「直感」触发后可以超射程反击:
if(isset($pd['skill_c2_intuit']))
{
$sk_dice = diceroll(99);
$sk_lvl = get_skilllvl('c2_intuit',$pd);
$sk_obbs = get_skillvars('c2_intuit','rangerate',$sk_lvl);
if($sk_dice < $sk_obbs)
{
return 1;
}
}
return 0;
}
......@@ -1482,6 +1564,8 @@
# 获取社团技能对反击率的修正
$counter *= rev_get_clubskill_bonus_counter($pd['club'],$pd['skills'],$pd,$pa['club'],$pa['skills'],$pa);
# 获取社团技能对反击率的修正(新)
$counter *= get_clbskill_counterate($pa,$pd,$active,$counter);
# 获取异常状态对反击率的影响
if(!empty($pd['inf']))
......
......@@ -28,7 +28,12 @@
if($bsk_cost) $pa['rage'] -= $bsk_cost;
# 成功释放主动技,应用标记
$pa['skill_'.$bsk] = 1;
$log .= "<span class=\"lime\">{$pa['nm']}消耗{$bsk_cost}点怒气,对{$pd['nm']}发动了技能「{$bsk_name}」!</span><br>";
$log .= "<span class=\"lime\">{$pa['nm']}{$pd['nm']}发动了技能「{$bsk_name}」!</span><br>";
# 检查是否需要addnews
addnews($now,'bsk_'.$bsk,$pa['name'],$pd['name']);
# 检查是否需要进行logsave
if(!$pd['type'] && $pd['nm']!='你') $pd['logsave'] .= "<span class=\"yellow\">{$pa['name']}</span>对你发动了技能<span class=\"red\">「{$bsk_name}」</span>!";
elseif(!$pa['type'] && $pa['nm']!='你') $pa['logsave'] .= "你对<span class=\"yellow\">{$pd['name']}</span>发动了技能<span class=\"red\">「{$bsk_name}」</span>!";
}
else
{
......@@ -49,7 +54,7 @@
foreach($pa['clbpara']['skill'] as $sk)
{
# 对于解锁技能,如果有特殊触发条件,在这里加入判定,否则会默认给一个触发标记
if(!check_skill_unlock($sk,$pa) && (get_skilltags($sk,'passive') || get_skilltags($sk,'inf')))
if((get_skilltags($sk,'passive') || get_skilltags($sk,'buff') || get_skilltags($sk,'inf')) && !check_skill_unlock($sk,$pa))
{
# 「猛击」特殊判定
if($sk == 'c1_crit')
......@@ -76,6 +81,76 @@
return;
}
# 获取社团技能对基础反击率的修正(新)
function get_clbskill_counterate(&$pa,&$pd,$active,$counterate)
{
#「直感」效果判定:
if(isset($pa['skill_c2_intuit']))
{
$sk_lvl = get_skilllvl('c2_intuit',$pa);
//获取反击倍率加成
$sk_r = 1 + (get_skillvars('c2_intuit','countergain',$sk_lvl) / 100);
$counterate *= $sk_r;
}
return $counterate;
}
# 获取社团技能对基础命中率的修正(新)
function get_clbskill_hitrate(&$pa,&$pd,$active,$hitrate)
{
#「直感」效果判定:
if(isset($pa['skill_c2_intuit']))
{
$sk_lvl = get_skilllvl('c2_intuit',$pa);
//获取命中倍率加成
$sk_r = 1 + (get_skillvars('c2_intuit','accgain',$sk_lvl) / 100);
$hitrate *= $sk_r;
}
return $hitrate;
}
# 获取社团技能对连击命中率的修正(新)
function get_clbskill_r_hitrate(&$pa,&$pd,$active,$hitrate)
{
#「直感」效果判定:
if(isset($pa['skill_c2_intuit']))
{
$sk_lvl = get_skilllvl('c2_intuit',$pa);
//获取连击命中率加成
$sk_r = 1 + (get_skillvars('c2_intuit','rbgain',$sk_lvl) / 100);
$hitrate *= $sk_r;
}
return $hitrate;
}
# 获取社团技能对伤害浮动的修正(新)
function get_clbskill_fluc(&$pa,&$pd,$active)
{
#「直感」效果判定:
if(isset($pa['skill_c2_intuit']))
{
$sk_lvl = get_skilllvl('c2_intuit',$pa);
//获取伤害浮动加成
$sk_fix = get_skillvars('c2_intuit','flucgain',$sk_lvl);
return $sk_fix;
}
return 0;
}
# 获取社团技能对单个属性基础伤害的定值补正
function get_clbskill_ex_base_dmg_fix(&$pa,&$pd,$active,$key)
{
$ex_dmg_fix = 0;
# 「歼灭」效果判定:
if(isset($pa['skill_buff_annihil']))
{
global $ex_wep_dmg;
$sk_var = round($pa['att']/$ex_wep_dmg[$key]);
$ex_dmg_fix += $sk_var;
}
return $ex_dmg_fix;
}
# 真红暮特殊判定
function attr_extra_19_crimson(&$pa,&$pd,$active,$phase=0)
{
......
......@@ -9,14 +9,9 @@
include_once GAME_ROOT.'./include/game/dice.func.php';
# 获得指定技能 $sk:技能名;$para:$clbpara
function getclubskill($sk,&$para=NULL)
function getclubskill($sk,&$para)
{
global $now,$cskills;
if(!$para)
{
global $clbpara;
$para = &$clbpara;
}
if(isset($cskills[$sk]) && (empty($para['skill']) || !in_array($sk,$para['skill'])))
{
$para['skill'][] = $sk;
......@@ -31,8 +26,8 @@
{
foreach($cskills[$sk]['slast'] as $ltkey => $lt)
{
# 定义初次获得时间戳
if($ltkey == 'lasttimes') $para['starttimes'][$sk] = $now;
# 预设不是以回合为单位的 设置初始时间戳
if($ltkey != 'lastturns') $para['starttimes'][$sk] = $now;
# 防呆
if($ltkey == 'lasttimes' || $ltkey == 'lastturns') $para[$ltkey][$sk] = $lt;
}
......@@ -42,15 +37,23 @@
}
# 失去指定技能 $sk:技能名;$para:$clbpara
function lostclubskill($sk,&$para=NULL)
function lostclubskill($sk,&$para)
{
if(!$para)
{
global $clbpara;
$para = &$clbpara;
}
global $cskills;
if(in_array($sk,$para['skill']))
{
# 检查技能丢失时是否要执行事件
if(isset($cskills[$sk]['lostevents']))
{
foreach($cskills[$sk]['lostevents'] as $event)
{
if(strpos($event,'unactive_')===0)
{
$uskid = substr($event,9);
set_skillpara($uskid,'active',0,$para);
}
}
}
$sk_key = array_search($sk,$para['skill']);
unset($para['skill'][$sk_key]);
# 失去指定技能时,注销对应技能参数
......@@ -98,7 +101,7 @@
# 升级指定技能 $sk:技能名;$nums:升级次数
function upgclbskills($sk,$nums=1)
{
global $log,$club,$clbpara,$skillpoint,$gamecfg;
global $log,$club,$clbpara,$skillpoint,$gamecfg,$now;
global $cskills;
# 合法性检查
......@@ -107,6 +110,8 @@
# 获取技能信息
$cskill = $cskills[$sk];
# 获取技能升级后文本
$clog = isset($cskill['log']) ? $cskill['log'] : '升级成功!<br>';
# 检查技能是否存在等级
if(isset($cskill['maxlvl']))
{
......@@ -118,23 +123,23 @@
}
}
# 获取技能此次升级需要消耗的技能点
$cost = isset($now_clvl) ? $cskill['cost'][$now_clvl] : $cskill['cost'];
if($nums > 1) $cost *= $nums;
if($cost > $skillpoint)
if(isset($cskill['cost']))
{
$log .= "技能点不足。<br>";
return;
$cost = isset($now_clvl) ? $cskill['cost'][$now_clvl] : $cskill['cost'];
if($nums > 1) $cost *= $nums;
if($cost > $skillpoint)
{
$log .= "技能点不足。<br>";
return;
}
$clog = str_replace("[:cost:]",$cost,$clog);
}
# 获取技能升级后文本
$clog = $cskill['log'];
$clog = str_replace("[:cost:]",$cost,$clog);
# 检查技能升级后会触发的事件:
if(isset($cskill['events']))
{
foreach($cskill['events'] as $event)
{
$flag = upgclbskills_events($event);
$flag = upgclbskills_events($event,$sk);
}
# 会触发多个事件时,只要有一个事件成功触发就会继续升级流程
if(!$flag) return;
......@@ -174,7 +179,7 @@
}
}
# 扣除技能点
$skillpoint -= $cost;
if(!empty($cost)) $skillpoint -= $cost;
$log .= $clog;
# 存在复选框的技能,升级后重载技能页面
if(isset($cskill['num_input']))
......@@ -186,12 +191,13 @@
}
# 升级指定技能会触发的事件,返回0时代表无法升级技能
function upgclbskills_events($event)
function upgclbskills_events($event,$sk)
{
global $log;
global $log,$cskills,$clbpara;
# 事件:治疗
if($event == 'heal')
{
# 升级治疗技能时,回复满生命、体力,并清空所有异常状态
# 事件效果:回复满生命、体力,并清空所有异常状态
global $hp,$mhp,$sp,$msp,$inf;
$heal_flag = 0;
if(!empty($inf))
......@@ -211,6 +217,54 @@
$log .= "你不需要使用这个技能!<br>";
return 0;
}
return 1;
}
# 事件:获取指定技能
if(strpos($event,'getskill_') === 0)
{
# 事件效果:获取一个登记过的技能
$gskid = substr($event,9);
if(isset($cskills[$gskid]))
{
getclubskill($gskid,$clbpara);
}
else
{
$log .= "技能{$gskid}不存在!这可能是一个BUG,请联系管理员。<br>";
return 0;
}
return 1;
}
# 事件:为指定技能设置开始时间
if(strpos($event,'setstarttimes_') === 0)
{
$gskid = substr($event,14);
if(isset($cskills[$gskid]))
{
set_starttimes($gskid,$clbpara);
}
else
{
$log .= "技能{$gskid}不存在!这可能是一个BUG,请联系管理员。<br>";
return 0;
}
return 1;
}
# 事件:为指定技能设置持续时间
if(strpos($event,'setlasttimes_') === 0)
{
$gskarr = substr($event,13);
$gskarr = explode('+',$gskarr);
$gskid = $gskarr[0]; $gsklst = $gskarr[1];
if(isset($cskills[$gskid]) && $gsklst)
{
set_lasttimes($gskid,$gsklst,$clbpara);
}
else
{
$log .= "技能{$gskid}不存在或持续时间{$gsklst}无效!这可能是一个BUG,请联系管理员。<br>";
return 0;
}
}
return 1;
}
......@@ -247,13 +301,26 @@
$log.="你不能升级此技能。<br>";
return 0;
}
# 检查冷却技能是否解锁
if(check_skill_unlock($sk))
{
$cskill = $cskills[$sk];
if(is_array($unlock_flag))
{
$unlock_cd = $unlock_flag[1]; $unlock_flag = $unlock_flag[0];
}
$unlock_flag = is_array($cskill['lockdesc']) ? $cskill['lockdesc'][$unlock_flag] : $cskill['lockdesc'];
$log .= $unlock_flag;
return 0;
}
return 1;
}
# 技能是否解锁,返回为0时解锁,否则返回对应的未满足条件 $sk:技能名;$data:角色数据
function check_skill_unlock($sk,$data)
function check_skill_unlock($sk,$data=NULL)
{
global $cskills;
global $cskills,$now;
if(!$data) $data = current_player_save();
$data['clbpara'] = get_clbpara($data['clbpara']);
if(!in_array($sk,$data['clbpara']['skill']))
{
......@@ -264,7 +331,20 @@
$unlock = $cskills[$sk]['unlock'];
foreach($unlock as $key => $lock)
{
if(strpos($key,'+')!==false)
if($key == 'skillcooldown')
{
$st = get_starttimes($sk,$data['clbpara']);
if($st)
{
$cd = get_skillvars($sk,'cd');
if($now < $st+$cd)
{
$last_cd = $st+$cd-$now;
return Array($key,$last_cd);
}
}
}
elseif(strpos($key,'+')!==false)
{
$arr_key = explode("+",$key);
foreach($arr_key as $skey)
......@@ -273,6 +353,12 @@
}
if(!eval("return ($lock);")) return $key;
}
elseif(strpos($key,'-')!==false)
{
$arr_key = explode("-",$key);
$lock = str_replace("[:".$arr_key[1].":]","\$data['clbpara']['{$arr_key[0]}']['{$sk}']['".$arr_key[1]."']",$lock);
if(!eval("return ($lock);")) return $key;
}
else
{
$lock = str_replace("[:".$key.":]","\$data['".$key."']",$lock);
......@@ -302,7 +388,7 @@
}
# 获取指定技能标签 $sk:技能名;$stag:要寻找的特定标签;(非必须)$para:$clbpara
function get_skilltags($sk,$stag='',&$para=NULL)
function get_skilltags($sk,$stag='')
{
global $cskills;
$cskill = $cskills[$sk];
......@@ -335,12 +421,63 @@
}
# 获取保存在clbpara内的指定技能参数 $sk:技能名;$skpara:指定技能参数;$data:角色数据
function get_skillpara($sk,$skpara,$data)
function get_skillpara($sk,$skpara,$para)
{
if(isset($para['skillpara'][$sk][$skpara])) return $para['skillpara'][$sk][$skpara];
return 0;
}
# 变更保存在clbpara['skillpara']内的指定技能参数
function set_skillpara($sk,$skpara,$skdata,&$para)
{
$para['skillpara'][$sk][$skpara] = $skdata;
return;
}
# 获取指定技能的开始时间
function get_starttimes($sk,$para)
{
if(isset($para['starttimes'][$sk])) return $para['starttimes'][$sk];
return 0;
}
# 设定指定技能的开始时间
function set_starttimes($sk,&$para,$times=0)
{
global $now;
$t = $times ? $times : $now;
$para['starttimes'][$sk] = $t;
return;
}
# 获取指定技能持续时间
function get_lasttimes($sk,$para)
{
if(isset($para['lasttimes'][$sk])) return $para['lasttimes'][$sk];
return 0;
}
# 变更保存在clbpara['lasttimes']内的指定技能持续时间
function set_lasttimes($sk,$skdata,&$para)
{
if(isset($data['clbpara']['skillpara'][$sk][$skpara])) return $data['clbpara']['skillpara'][$sk][$skpara];
$para['lasttimes'][$sk] = $skdata;
return;
}
# 获取指定技能持续回合
function get_lastturns($sk,$para)
{
if(isset($para['lastturns'][$sk])) return $para['lastturns'][$sk];
return 0;
}
# 变更保存在clbpara['lastturns']内的指定技能持续回合
function set_lastturns($sk,$skdata,&$para)
{
$para['lastturns'][$sk] = $skdata;
return;
}
# 获取指定技能等级
function get_skilllvl($sk,$data)
{
......@@ -351,7 +488,7 @@
# 格式化指定技能描述文本 $shortdesc:不显示等级、标签描述
function parse_skilldesc($sk,$data,$shortdesc=0)
{
global $cskills;
global $cskills,$cskills_tags,$now;
# 初始化技能描述
$cskill = $cskills[$sk];
$sk_desc = $shortdesc && isset($cskill['bdesc']) ? $cskill['bdesc'] : $cskill['desc'];
......@@ -361,9 +498,7 @@
$tag_desc = '';
foreach($cskill['tags'] as $sk_tag)
{
if($sk_tag == 'battle') $tag_desc .= '<span tooltip="可以在战斗中主动使用" class="gold">【战斗技】</span>';
if($sk_tag == 'active') $tag_desc .= '<span tooltip="不能在追击/鏖战状态下使用" class="gold">【先制】</span>';
if($sk_tag == 'passive') $tag_desc .= '<span tooltip="满足条件时自动触发" class="gold">【被动技】</span>';
if(isset($cskills_tags[$sk_tag])) $tag_desc .= $cskills_tags[$sk_tag];
}
if(!empty($tag_desc)) $tag_desc .= ' ';
}
......@@ -395,6 +530,14 @@
# 技能存在其他静态参数时
if(isset($cskill['vars']))
{
# 技能存在关联技能,且关联技能有静态参数,一并处理
if(isset($cskill['link']))
{
foreach($cskill['link'] as $lksk)
{
if(isset($cskills[$lksk]['vars'])) $cskill['vars'] = array_merge($cskill['vars'],$cskills[$lksk]['vars']);
}
}
foreach($cskill['vars'] as $key => $var)
{
# 静态参数是数组的情况下 选用当前等级对应的参数
......@@ -403,7 +546,34 @@
$sk_desc = str_replace("[:".$key.":]",$var,$sk_desc);
}
}
# 如果输入了玩家数据,则可以根据数据判定技能关联,否则关联默认属性
# 技能存在动态参数
if(isset($cskill['pvars']))
{
foreach($cskill['pvars'] as $pvar)
{
if($pvar == 'lasttimes' || $pvar == 'starttimes' || $pvar == 'lastturns')
{
if(isset($data['clbpara'][$pvar][$sk]))
{
$tpvar = $data['clbpara'][$pvar][$sk];
if($pvar == 'lasttimes')
{
$tpvar = $data['clbpara']['starttimes'][$sk] + $tpvar - $now;
}
$sk_desc = str_replace("[^".$pvar."^]",$tpvar,$sk_desc);
}
}
else
{
if(isset($data[$pvar]))
{
$sk_desc = str_replace("[^".$pvar."^]",$data[$pvar],$sk_desc);
}
}
}
}
# 技能存在关联属性
if(isset($cskill['status']))
{
# 检查技能升级是否会直接影响属性:
......
......@@ -365,9 +365,10 @@
{
if($active)
{
$w_log = "手持<span class=\"red\">{$pa['wep_name']}</span>的<span class=\"yellow\">{$pa['name']}</span>向你袭击!<br>你受到其<span class=\"yellow\">$att_dmg</span>点攻击,对其做出了<span class=\"yellow\">$def_dmg</span>点反击。<br>";
$w_log = "手持<span class=\"red\">{$pa['wep_name']}</span>的<span class=\"yellow\">{$pa['name']}</span>向你袭击!<br>";
if(isset($pd['logsave'])) $w_log .= $pd['logsave'];
if(isset($pd['lvlup_log'])) $w_log .= $pd['lvlup_log'];
$w_log .= "你受到其<span class=\"yellow\">$att_dmg</span>点攻击,对其做出了<span class=\"yellow\">$def_dmg</span>点反击。<br>";
logsave ($pd['pid'],$now,$w_log,'c');
}
else
......@@ -375,6 +376,7 @@
$w_log = "你发现了手持<span class=\"red\">{$pd['wep_name']}</span>的<span class=\"yellow\">{$pd['name']}</span>并且先发制人!<br>你对其做出<span class=\"yellow\">$att_dmg</span>点攻击,受到其<span class=\"yellow\">$def_dmg</span>点反击。<br>";
if(isset($pa['logsave'])) $w_log .= $pa['logsave'];
if(isset($pa['lvlup_log'])) $w_log .= $pa['lvlup_log'];
$w_log .= "你受到其<span class=\"yellow\">$att_dmg</span>点攻击,对其做出了<span class=\"yellow\">$def_dmg</span>点反击。<br>";
logsave ($pa['pid'],$now,$w_log,'c');
}
}
......@@ -646,12 +648,19 @@
}
//获取最终伤害的定值变化(伤害制御、剔透)
$fin_damage_fix = get_final_dmg_fix($pa,$pd,$active,$damage);
if($fin_damage_fix > 0) $damage = $fin_damage_fix;
if($fin_damage_fix > 0)
{
$o_damage = $damage;
$damage = $fin_damage_fix;
}
//存在物理伤害以外的其他伤害 输出一段最终伤害log:
if($pdamage != $damage)
{
if(isset($fd_log) && !$fin_damage_fix) $log .= "<span class=\"yellow\">造成的总伤害:{$fd_log}=<span class=\"red\">$damage</span>。</span><br>";
else $log .= "<span class=\"yellow\">造成的总伤害:<span class=\"red\">$damage</span>。</span><br>";
$log .= "<span class=\"yellow\">造成的总伤害:";
if(isset($fd_log)) $log .= $fd_log.'=';
$log .= "<span class=\"red\">{$damage}";
if(isset($o_damage) && $o_damage != $damage) $log .= "({$o_damage})";
$log .= "</span>。</span><br>";
}
}
//将造成的最终伤害登记在$pa['final_damage']内
......
......@@ -7,7 +7,7 @@ if(!defined('IN_GAME')) {
include_once GAME_ROOT.'./include/game/titles.func.php';
function nparse_news($start = 0, $range = 0 ){//$type = '') {
global $week,$nowep,$db,$tablepre,$lwinfo,$plsinfo,$hplsinfo,$wthinfo,$typeinfo,$exdmginf,$newslimit;
global $week,$nowep,$db,$tablepre,$lwinfo,$plsinfo,$hplsinfo,$wthinfo,$typeinfo,$exdmginf,$newslimit,$cskills;
//$file = $file ? $file : $newsfile;
//$ninfo = openfile($file);
$range = $range == 0 ? $newslimit : $range ;
......@@ -315,6 +315,10 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"orange\">{$a}发送了控制指令,全部禁区解除!</span><br>\n";
} elseif($news == 'csl_addarea') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"orange\">{$a}发送了控制指令,下一回禁区提前到来了!</span><br>\n";
} elseif(strpos($news,'bsk_')===0) {
$bsk = substr($news,4);
$bname = $cskills[$bsk]['name'];
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"clan\">{$a}{$b}发动了技能<span class=\"yellow\">「{$bname}」</span>!</span><br>\n";
} else {
$newsinfo .= "<li>$time,$news,$a,$b,$c,$d<br>\n";
}
......
......@@ -84,9 +84,12 @@ if($mode == 'enter') {
$itm[1] = '面包'; $itmk[1] = 'HH'; $itme[1] = 120; $itms[1] = 15;
$itm[2] = '矿泉水'; $itmk[2] = 'HS'; $itme[2] = 140; $itms[2] = 15;
//$itm[6] = '银白盒子'; $itmk[6] = 'p'; $itme[6] = 1; $itms[6] = 1; $itmsk[6] = 'ps';
//$itm[5] = '秋刀鱼罐头'; $itmk[5] = 'HB'; $itme[5] = 70; $itms[5] = 15;
$itm[5] = 'GRAND OPENING 「开门大吉」'; $itmk[5] = 'p000'; $itme[5] = 1; $itms[5] = 1;
$itm[5] = '秋刀鱼罐头'; $itmk[5] = 'HB'; $itme[5] = 70; $itms[5] = 15;
//$itm[5] = 'GRAND OPENING 「开门大吉」'; $itmk[5] = 'p000'; $itme[5] = 1; $itms[5] = 1;
$dice = rand(1,2);
if($dice == 1){$itm[5] = '「铁拳无敌 社团卡」'; $itmk[5] = 'ZB'; $itme[5] = 1; $itms[5] = 1;}
else{$itm[5] = '「见敌必斩 社团卡」'; $itmk[5] = 'ZB'; $itme[5] = 2; $itms[5] = 1;}
if ($wingames <=1){
$itm[6] = '银白盒子'; $itmk[6] = 'ps'; $itme[6] = 1; $itms[6] = 1; $itmsk[6] = '';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment