本文整理汇总了PHP中import_module函数的典型用法代码示例。如果您正苦于以下问题:PHP import_module函数的具体用法?PHP import_module怎么用?PHP import_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了import_module函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_skill400_proc
function check_skill400_proc(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('skill400', 'player', 'logger'));
if (!\skillbase\skill_query(400, $pa) || !check_unlocked400($pa)) {
return array();
}
$l400 = \skillbase\skill_getvalue(400, 'lvl', $pa);
if (rand(0, 99) < $procrate[$l400]) {
if ($active) {
if ($l400 >= 5) {
$log .= "<span class=\"yellow\">你朝{$pd['name']}打出了猛烈的一击!</span><br>";
} else {
$log .= "<span class=\"yellow\">你朝{$pd['name']}打出了重击!</span><br>";
}
} else {
if ($l400 == 5) {
$log .= "<span class=\"yellow\">{$pa['name']}朝你打出了猛烈的一击!</span><br>";
} else {
$log .= "<span class=\"yellow\">{$pa['name']}朝你打出了重击!</span><br>";
}
}
$dmggain = (100 + $attgain[$l400]) / 100;
return array($dmggain);
}
return array();
}
示例2: check_skill35_proc
function check_skill35_proc(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('skill35', 'player', 'logger'));
if (!\skillbase\skill_query(35, $pa) || !check_unlocked35($pa)) {
return array();
}
if ($pa['wepk'] != 'WP') {
return array();
}
if (rand(0, 99) < calculate_skill35_proc_rate($pa, $pd, $active)) {
if ($active) {
$log .= "<span class=\"yellow\">你朝着{$pd['name']}打出了凶猛的一击!<span class=\"clan\">敌人被打晕了过去!</span></span><br>";
} else {
$log .= "<span class=\"yellow\">{$pa['name']}朝你打出了凶猛的一击!<span class=\"clan\">你被打晕了过去!</span></span><br>";
}
$clv = (int) \skillbase\skill_getvalue(35, 'lvl', $pa);
$dmggain = (100 + $attgain[$clv]) / 100;
\skill602\set_stun_period($sk35_stuntime[$clv] * 1000, $pd);
\skill602\send_stun_battle_news($pa['name'], $pd['name']);
return array($dmggain);
}
return array();
}
示例3: bufficons_list
function bufficons_list()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player'));
\player\update_sdata();
if (\skillbase\skill_query(456, $sdata) && check_unlocked456($sdata)) {
eval(import_module('skill456'));
$skill456_time = $now - $starttime;
$z = array('disappear' => 0);
if ($skill456_time < $skill456_act_time) {
$z['clickable'] = 1;
$z['style'] = 1;
$z['totsec'] = $skill456_act_time;
$z['nowsec'] = $skill456_time;
$skill456_rm = $skill456_act_time - $skill456_time;
$z['hint'] = "技能「突击」";
} else {
$z['clickable'] = 0;
$z['style'] = 3;
$z['activate_hint'] = "技能「突击」生效时间已经结束";
}
\bufficons\bufficon_show('img/skill456.gif', $z);
}
$chprocess();
}
示例4: check_ex_dmg_nullify
function check_ex_dmg_nullify(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('ex_dmg_att', 'logger'));
$ex_att_array = \attrbase\get_ex_attack_array($pa, $pd, $active);
$ex_def_array = \attrbase\get_ex_def_array($pa, $pd, $active);
//有属性攻击才进入判断
$flag = 0;
$exnum = 0;
foreach ($ex_attack_list as $key) {
if (in_array($key, $ex_att_array)) {
$flag = 1;
$exnum++;
}
}
if ($flag && in_array('b', $ex_def_array)) {
$proc_rate = get_ex_dmg_nullify_proc_rate($pa, $pd, $active);
$dice = rand(0, 99);
if ($dice < $proc_rate) {
$log .= "<span class=\"red\">属性攻击的力量完全被防具吸收了!</span>只造成了<span class=\"red\">{$exnum}</span>点伤害!<br>";
$pa['ex_dmg_dealt'] = $exnum;
$pd['exdmg_nullify_success'] = 1;
return 1;
} else {
$log .= "纳尼?防具使属性攻击无效化的属性竟然失效了!<br>";
return 0;
}
}
return 0;
}
示例5: itemuse
function itemuse(&$theitem)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'itemmain', 'logger'));
$itm =& $theitem['itm'];
$itmk =& $theitem['itmk'];
$itme =& $theitem['itme'];
$itms =& $theitem['itms'];
$itmsk =& $theitem['itmsk'];
if (strpos($itmk, 'A') === 0) {
$eqp = 'art';
$noeqp = '';
if ($noeqp && strpos(${$eqp . 'k'}, $noeqp) === 0 || !${$eqp . 's'}) {
${$eqp} = $itm;
${$eqp . 'k'} = $itmk;
${$eqp . 'e'} = $itme;
${$eqp . 's'} = $itms;
${$eqp . 'sk'} = $itmsk;
$log .= "装备了<span class=\"yellow\">{$itm}</span>。<br>";
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
} else {
swap(${$eqp}, $itm);
swap(${$eqp . 'k'}, $itmk);
swap(${$eqp . 'e'}, $itme);
swap(${$eqp . 's'}, $itms);
swap(${$eqp . 'sk'}, $itmsk);
$log .= "卸下了<span class=\"red\">{$itm}</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
}
return;
}
$chprocess($theitem);
}
示例6: strike_finish
function strike_finish(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
if (\skillbase\skill_query(263, $pd) && check_unlocked263($pd)) {
if (\skillbase\skill_query(261, $pd)) {
$t = (int) \skillbase\skill_getvalue(261, 'lastuse', $pd);
if ($t > 0) {
$chance = 35;
} else {
$chance = 20;
}
} else {
$chance = 20;
}
if ($pd['club'] != 19) {
$chance = 10;
}
if (rand(0, 99) < $chance) {
eval(import_module('logger'));
$dmgred = min($pd['wp'], 800);
if ($active) {
$log .= '<span class="yellow">敌人精湛的格斗技术抵挡了' . $dmgred . '点伤害!</span><br>';
} else {
$log .= '<span class="yellow">你精湛的格斗技术抵挡了' . $dmgred . '点伤害!</span><br>';
}
$pa['dmg_dealt'] -= $dmgred;
if ($pa['dmg_dealt'] < 1) {
$pa['dmg_dealt'] = 1;
}
}
}
return $chprocess($pa, $pd, $active);
}
示例7: itemuse
function itemuse(&$theitem)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys', 'player', 'itemmain', 'logger'));
$itm =& $theitem['itm'];
$itmk =& $theitem['itmk'];
$itme =& $theitem['itme'];
$itms =& $theitem['itms'];
$itmsk =& $theitem['itmsk'];
if (strpos($itmk, 'Y') === 0 || strpos($itmk, 'Z') === 0) {
if ($itm == '消音器') {
if (strpos($wepk, 'WG') !== 0) {
$log .= '你没有装备枪械,不能使用消音器。<br>';
} elseif (strpos($wepsk, 'S') === false) {
$wepsk .= 'S';
$log .= "你给<span class=\"yellow\">{$wep}</span>安装了<span class=\"yellow\">{$itm}</span>。<br>";
\itemmain\itms_reduce($theitem);
} else {
$log .= "你的武器已经安装了消音器。<br>";
}
return;
}
}
$chprocess($theitem);
}
示例8: finalize310
function finalize310(&$pa, $data)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
if ($data == '') {
$x = 0;
} else {
$x = base64_decode_number($data);
}
$ox = $x;
$x += \skillbase\skill_getvalue(310, 'cnt', $pa);
$x = min($x, (1 << 30) - 1);
if ($ox < 100 && $x >= 100) {
\cardbase\get_qiegao(100, $pa);
}
eval(import_module('cardbase'));
$arr = $cardindex['A'];
$c = count($arr) - 1;
$cr = $arr[rand(0, $c)];
if ($ox < 2500 && $x >= 2500) {
\cardbase\get_qiegao(400, $pa);
\cardbase\get_card($cr, $pa);
}
$cr = $arr[rand(0, $c)];
if ($ox < 10000 && $x >= 10000) {
\cardbase\get_qiegao(1500, $pa);
\cardbase\get_card($cr, $pa);
}
return base64_encode_number($x, 5);
}
示例9: get_physical_dmg_multiplier
function get_physical_dmg_multiplier(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
$r = array();
if (\skillbase\skill_query(262, $pa) && check_unlocked262($pa) && $pa['user_commanded'] == 1 && $active && !$pa['is_counter'] && (!isset($pa['sk262flag']) || !$pa['sk262flag'])) {
eval(import_module('logger'));
$ct = floor(getmicrotime() * 1000);
$st = (int) \skillbase\skill_getvalue(262, 'ct', $pa);
$t = $ct - $st;
//$log.='t='.$t;
$pretime = skill262_get_pretime($pa);
$dmgperc = skill262_get_dmgperc($pa);
$maxdmgperc = skill262_get_maxdmgperc($pa);
//$log.=' pretime='.$pretime.' dmgperc='.$dmgperc.' maxdmgperc='.$maxdmgperc;
if ($t < $pretime) {
$z = 0;
} else {
$z = ($t - $pretime) / 1000 * $dmgperc;
$z = min($z, $maxdmgperc);
$z = round($z);
$log .= '<span class="lime">你积蓄力量打出了致命的一拳!伤害增加了' . $z . '%!</span><br>';
}
$r = array(1 + $z / 100);
}
return array_merge($r, $chprocess($pa, $pd, $active));
}
示例10: upgrade12
function upgrade12()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('player', 'logger'));
if (!\skillbase\skill_query(12)) {
$log .= '你没有这个技能!<br>';
return;
}
if ($skillpoint < 1) {
$log .= '技能点不足。<br>';
return;
}
eval(import_module('wound'));
$flag = false;
$log .= "消耗了<span class='lime'>1</span>点技能点,<br>";
for ($i = 0; $i < strlen($inf); $i++) {
$log .= "{$infname[$inf[$i]]}状态解除了。<br>";
$flag = true;
}
$inf = '';
if (!$flag) {
$log .= '但是什么也没发生。<br>';
}
$skillpoint--;
$inf = '';
}
示例11: upgrade227
function upgrade227()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('player', 'logger', 'input'));
$skillpara1 = (int) $skillpara1;
if (!\skillbase\skill_query(227) || !check_unlocked227($sdata)) {
$log .= '你没有这个技能。<br>';
return;
}
if (!\sklearn_util\sklearn_basecheck($skillpara1) || !sklearn_checker227('is_learnable', $skillpara1)) {
$log .= '你不可以学习这个技能!<br>';
return;
}
if (!sklearn_checker227('now_learnable', $skillpara1)) {
$log .= '现在尚没有足够资源学习这个技能!<br>';
return;
}
if (\skillbase\skill_query($skillpara1)) {
$log .= '你已经拥有这个技能了!<br>';
return;
}
if ((int) \skillbase\skill_getvalue(227, 'l') != 0) {
$log .= '你已经学习过一个技能了!<br>';
return;
}
\skillbase\skill_setvalue(227, 'l', $skillpara1);
\skillbase\skill_acquire($skillpara1);
$log .= '学习成功。<br>';
}
示例12: findTemplateLoader
public static function findTemplateLoader($loader)
{
if (is_array($loader)) {
$loader = $loader[0];
$args = py_slice($loader, 1);
} else {
$args = array();
}
if (is_string($loader)) {
$expl_ = explode('.', $loader);
$module = join('.', py_slice($expl_, 0, -1));
$attr = $expl_[count($expl_) - 1];
try {
$mod = import_module($module);
} catch (ImportError $e) {
throw new ImproperlyConfigured('Error importing template source loader ' . $loader . ': "' . $e . '"');
}
if (!$mod instanceof BaseLoader) {
throw new ImproperlyConfigured('Error importing template source loader ' . $loader . ': module doesn\'t return a BaseLoader descendant object.');
}
$TemplateLoader = $mod;
if (isset($TemplateLoader->load_template_source)) {
$func = new $TemplateLoader($args);
} else {
// Try loading module the old way - string is full path to callable
if ($args) {
throw new ImproperlyConfigured('Error importing template source loader ' . $loader . ' - can\'t pass arguments to function-based loader.');
}
$func = $TemplateLoader;
}
return $func;
} else {
throw new ImproperlyConfigured('Loader does not define a "load_template" callable template source loader');
}
}
示例13: check_itmsk
function check_itmsk($nm, &$pa = NULL)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('player', 'logger'));
if ($pa == NULL) {
foreach ($battle_equip_list as $itm) {
foreach (\itemmain\get_itmsk_array(${$itm . 'sk'}) as $key) {
if ($key == $nm) {
return 1;
}
}
}
return 0;
} else {
foreach ($battle_equip_list as $itm) {
foreach (\itemmain\get_itmsk_array($pa[$itm . 'sk']) as $key) {
if ($key == $nm) {
return 1;
}
}
}
return 0;
}
}
示例14: show_achievements
function show_achievements()
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('sys'));
$res = $db->query("SELECT n_achievements FROM {$gtablepre}users WHERE username='{$cuser}'");
if (!$db->num_rows($res)) {
return;
}
$zz = $db->fetch_array($res);
$ach = $zz['n_achievements'];
$achdata = explode(';', $ach);
for ($key = 1; $key <= 1000; $key++) {
if (defined('MOD_SKILL' . $key . '_INFO') && defined('MOD_SKILL' . $key . '_ACHIEVEMENT_ID')) {
if (strpos(constant('MOD_SKILL' . $key . '_INFO'), 'achievement;') !== false) {
$id = (int) constant('MOD_SKILL' . $key . '_ACHIEVEMENT_ID');
if (isset($achdata[$id])) {
$s = (string) $achdata[$id];
} else {
$s = '';
}
$func = '\\skill' . $key . '\\show_achievement' . $key;
echo '成就编号' . $id . ' 技能编号' . $key . ' 成就信息<br><br>';
$func($s);
echo '<br><br>';
}
}
}
}
示例15: check_skill401_proc
function check_skill401_proc(&$pa, &$pd, $active)
{
if (eval(__MAGIC__)) {
return $___RET_VALUE;
}
eval(import_module('skill401', 'player', 'logger'));
if (!\skillbase\skill_query(401, $pd) || !check_unlocked401($pd)) {
return array();
}
$l401 = \skillbase\skill_getvalue(401, 'lvl', $pd);
if ($l401 > 0) {
if ($active) {
if ($l401 == 5) {
$log .= "<span class=\"yellow\">{$pd['name']}的护甲使其几乎刀枪不入!</span><br>";
} else {
$log .= "<span class=\"yellow\">{$pd['name']}坚硬的护甲减少了你造成的物理伤害!</span><br>";
}
} else {
if ($l401 == 5) {
$log .= "<span class=\"yellow\">你的护甲使你几乎刀枪不入!</span><br>";
} else {
$log .= "<span class=\"yellow\">你坚硬的护甲减少了{$pa['name']}造成的物理伤害!</span><br>";
}
}
$dmggain = (100 - $dmgreduce[$l401]) / 100;
return array($dmggain);
}
return array();
}