当前位置: 首页>>代码示例>>PHP>>正文


PHP addnews函数代码示例

本文整理汇总了PHP中addnews函数的典型用法代码示例。如果您正苦于以下问题:PHP addnews函数的具体用法?PHP addnews怎么用?PHP addnews使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了addnews函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: activate76

function activate76()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill76', 'player', 'logger', 'sys'));
    \player\update_sdata();
    if (!\skillbase\skill_query(76) || !check_unlocked76($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill76_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 1) {
        $log .= '你已经发动过这个技能了!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '技能冷却中!<br>';
        return;
    }
    \skillbase\skill_setvalue(76, 'lastuse', $now);
    $rage = 100;
    addnews(0, 'bskill76', $name);
    $log .= '<span class="lime">技能「充能」发动成功。</span><br>';
}
开发者ID:winddramon,项目名称:dts,代码行数:29,代码来源:main.php

示例2: kill

function kill(&$pa, &$pd)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess($pa, $pd);
    eval(import_module('sys', 'logger'));
    if (in_array($pd['state'], array(20, 21, 22, 23, 24, 25, 27, 29))) {
        if (\skillbase\skill_query(58, $pd) && (int) \skillbase\skill_getvalue(58, 'r', $pd) == 0) {
            \skillbase\skill_setvalue(58, 'r', '1', $pd);
            if ($pd['state'] == 27 && !$pd['sourceless']) {
                $log .= "<span class=\"lime\">但是,由于你及时按下了BOMB键,你原地满血复活了!</span><br>";
                $w_log = "<span class=\"lime\">但是,由于{$pd['name']}及时按下了BOMB键,其原地满血复活了!</span><br>";
                \logger\logsave($pa['pid'], $now, $w_log, 'b');
            } else {
                //击杀复活提示将接管player_kill_enemy进行
            }
            $pd['state'] = 0;
            $pd['hp'] = $pd['mhp'];
            $pd['skill58_flag'] = 1;
            if ($pd['type'] == 0) {
                $alivenum++;
            }
            save_gameinfo();
            addnews($now, 'revival', $pd['name']);
            //满血复活时加成效果(这个其实是技能“新生”的内容,但直接做在一起好了)
            $pd['mhp'] += $pd['lvl'] * 2;
            $pd['hp'] += $pd['lvl'] * 2;
            $pd['def'] += $pd['lvl'] * 5;
        }
    }
}
开发者ID:DTS-China,项目名称:dts,代码行数:32,代码来源:main.php

示例3: gamestateupdate

function gamestateupdate()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    $chprocess();
    eval(import_module('sys', 'gameflow_combo'));
    if ($gamestate < 40 && $gamestate >= 30 && $alivenum <= $combolimit) {
        //判定进入连斗条件1:停止激活时玩家数少于特定值
        $gamestate = 40;
        addnews($now, 'combo');
        systemputchat($now, 'combo');
    } elseif ($gamestate < 40 && $gamestate >= 20 && $combonum && $deathnum >= $combonum) {
        //判定进入连斗条件2:死亡人数超过特定公式计算出的值
        $real_combonum = $deathlimit + ceil($validnum / $deathdeno) * $deathnume;
        if ($deathnum >= $real_combonum) {
            $gamestate = 40;
            addnews($now, 'combo');
            systemputchat($now, 'combo');
        } else {
            $combonum = $real_combonum;
            addnews($now, 'comboupdate', $combonum, $deathnum);
            systemputchat($now, 'comboupdate', $combonum);
        }
    }
}
开发者ID:Tian-hao,项目名称:dts,代码行数:26,代码来源:main.php

示例4: strike_prepare

function strike_prepare(&$pa, &$pd, $active)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($pa['bskill'] != 440) {
        return $chprocess($pa, $pd, $active);
    }
    if (!\skillbase\skill_query(440, $pa) || !check_unlocked440($pa)) {
        eval(import_module('logger'));
        $log .= '你尚未解锁这个技能!';
        $pa['bskill'] = 0;
    } else {
        eval(import_module('sys', 'skill440'));
        $l = \skillbase\skill_getvalue(440, 'lastuse', $pa);
        if ($pd['type'] == 0 && $now - $l >= $skill440_cd) {
            eval(import_module('logger'));
            if ($active) {
                $log .= "<span class=\"lime\">你对{$pd['name']}发动了技能「父爱」!</span><br>";
            } else {
                $log .= "<span class=\"lime\">{$pa['name']}对你发动了技能「父爱」!</span><br>";
            }
            \skillbase\skill_setvalue(440, 'lastuse', $now, $pa);
            $pd['skill440_flag'] = 1;
            addnews(0, 'bskill440', $pa['name'], $pd['name']);
        } else {
            if ($active) {
                eval(import_module('logger'));
                $log .= '因对方非玩家或其他原因而未发动技能。<br>';
            }
            $pa['bskill'] = 0;
        }
    }
    $chprocess($pa, $pd, $active);
}
开发者ID:sillycross,项目名称:dts,代码行数:35,代码来源:main.php

示例5: antiAFK

function antiAFK($timelimit = 0)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'gameflow_antiafk'));
    if (empty($timelimit)) {
        $timelimit = $antiAFKertime;
    }
    $timelimit *= 60;
    $deadline = $now - $timelimit;
    $result = $db->query("SELECT * FROM {$tablepre}players WHERE type=0 AND endtime < '{$deadline}' AND hp>'0' AND state<'10'");
    while ($al = $db->fetch_array($result)) {
        $afkerlist[$al['pid']] = array('name' => $al['name'], 'pls' => $al['pls']);
    }
    if (empty($afkerlist)) {
        return;
    }
    foreach ($afkerlist as $kid => $kcontent) {
        $db->query("UPDATE {$tablepre}players SET hp='0',state='32' WHERE pid='{$kid}' AND type='0' AND hp>'0' AND state<'10'");
        if ($db->affected_rows()) {
            addnews($now, 'death32', $kcontent['name'], '', $kcontent['pls']);
            $alivenum--;
            $deathnum++;
        }
    }
    save_gameinfo();
    return;
}
开发者ID:winddramon,项目名称:dts,代码行数:29,代码来源:main.php

示例6: strike_prepare

function strike_prepare(&$pa, &$pd, $active)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($pa['bskill'] != 60) {
        return $chprocess($pa, $pd, $active);
    }
    if (!\skillbase\skill_query(60, $pa) || !check_unlocked60($pa)) {
        eval(import_module('logger'));
        $log .= '你尚未解锁这个技能!';
        $pa['bskill'] = 0;
    } else {
        $rcost = get_rage_cost60($pa);
        if ($pa['rage'] >= $rcost) {
            eval(import_module('logger'));
            if ($active) {
                $log .= "<span class=\"lime\">你对{$pd['name']}发动了技能「恐惧」!</span><br>";
            } else {
                $log .= "<span class=\"lime\">{$pa['name']}对你发动了技能「恐惧」!</span><br>";
            }
            $pa['rage'] -= $rcost;
            $pa['skill60_flag'] = floor((1 - min(1, $pd['hp'] / $pd['mhp'])) * 100);
            addnews(0, 'bskill60', $pa['name'], $pd['name']);
        } else {
            if ($active) {
                eval(import_module('logger'));
                $log .= '怒气不足或其他原因不能发动。<br>';
            }
            $pa['bskill'] = 0;
        }
    }
    $chprocess($pa, $pd, $active);
}
开发者ID:DTS-China,项目名称:dts,代码行数:34,代码来源:main.php

示例7: strike_prepare

function strike_prepare(&$pa, &$pd, $active)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($pa['bskill'] != 253) {
        return $chprocess($pa, $pd, $active);
    }
    if (!\skillbase\skill_query(253, $pa) || !check_unlocked253($pa)) {
        eval(import_module('logger'));
        $log .= '你尚未解锁这个技能!';
        $pa['bskill'] = 0;
    } else {
        $rcost = get_rage_cost253($pa);
        if ($pa['rage'] >= $rcost) {
            eval(import_module('logger'));
            if ($active) {
                $log .= "<span class=\"lime\">你对{$pd['name']}发动了技能「天威」!</span><br>";
            } else {
                $log .= "<span class=\"lime\">{$pa['name']}对你发动了技能「天威」!</span><br>";
            }
            $pa['rage'] -= $rcost;
            addnews(0, 'bskill253', $pa['name'], $pd['name']);
            $pd['old_hp'] = $pd['hp'];
            //记录战斗开始时的hp,用于判定返还怒气
        } else {
            if ($active) {
                eval(import_module('logger'));
                $log .= '怒气不足或其他原因不能发动。<br>';
            }
            $pa['bskill'] = 0;
        }
    }
    $chprocess($pa, $pd, $active);
}
开发者ID:sillycross,项目名称:dts,代码行数:35,代码来源:main.php

示例8: strike_prepare

function strike_prepare(&$pa, &$pd, $active)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    if ($pa['bskill'] != 75) {
        return $chprocess($pa, $pd, $active);
    }
    if (!\skillbase\skill_query(75, $pa) || !check_unlocked75($pa)) {
        eval(import_module('logger'));
        $log .= '你尚未解锁这个技能!';
        $pa['bskill'] = 0;
    } else {
        eval(import_module('sys', 'skill75'));
        $l = \skillbase\skill_getvalue(75, 'lastuse', $pa);
        if ($now - $l >= $skill75_cd && $pa['wep_kind'] == 'K') {
            eval(import_module('logger'));
            if ($active) {
                $log .= "<span class=\"lime\">你对{$pd['name']}发动了技能「剑心」!</span><br>";
            } else {
                $log .= "<span class=\"lime\">{$pa['name']}对你发动了技能「剑心」!</span><br>";
            }
            \skillbase\skill_setvalue(75, 'lastuse', $now, $pa);
            addnews(0, 'bskill75', $pa['name'], $pd['name']);
        } else {
            if ($active) {
                eval(import_module('logger'));
                $log .= '冷却时间未到或其他原因不能发动。<br>';
            }
            $pa['bskill'] = 0;
        }
    }
    $chprocess($pa, $pd, $active);
}
开发者ID:winddramon,项目名称:dts,代码行数:34,代码来源:main.php

示例9: activate261

function activate261()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill261', 'player', 'logger', 'sys', 'itemmain'));
    \player\update_sdata();
    if (!\skillbase\skill_query(261) || !check_unlocked261($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill261_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '你已经使用过这个技能了!<br>';
        return;
    }
    \skillbase\skill_setvalue(261, 'lastuse', $now);
    $wp = $wp + $wp;
    addnews(0, 'bskill261', $name);
    $log .= '<span class="red">技能「决战」发动成功。</span><br>';
}
开发者ID:sillycross,项目名称:dts,代码行数:25,代码来源:main.php

示例10: activate430

function activate430()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill430', 'player', 'logger', 'sys', 'itemmain'));
    \player\update_sdata();
    if (!\skillbase\skill_query(430) || !check_unlocked430($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill430_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '技能冷却中!<br>';
        return;
    }
    \skillbase\skill_setvalue(430, 'lastuse', $now);
    $file = GAME_ROOT . "./include/modules/base/itemmain/config/mapitem.config.php";
    //真是丑陋!
    $itemlist = openfile($file);
    $in = sizeof($itemlist);
    $i = rand(1, $in - 1);
    list($iarea, $imap, $inum, $iname, $ikind, $ieff, $ista, $iskind) = explode(',', $itemlist[$i]);
    $itm0 = $iname;
    $itme0 = $ieff;
    $itms0 = $ista;
    $itmsk0 = $iskind;
    $itmk0 = $ikind;
    addnews(0, 'bskill430', $name, $iname);
    \itemmain\itemget();
}
开发者ID:hikawiier,项目名称:dtsmod-campfire,代码行数:35,代码来源:main.php

示例11: add_once_area

function add_once_area($atime)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'map'));
    if ($gamestate > 10 && $now > $atime) {
        $plsnum = sizeof($plsinfo) - 1;
        $areanum += $areaadd;
        for ($x = 0; $x <= $areanum; $x++) {
            if ($x > $plsnum) {
                continue;
            }
            add_new_killarea($arealist[$x], $atime);
        }
        if ($areanum >= $plsnum) {
            $areaaddlist = array_slice($arealist, $areanum - $areaadd + 1);
            $areanum = $plsnum;
        } else {
            if ($hack > 0) {
                $hack--;
            }
            $areaaddlist = array_slice($arealist, $areanum - $areaadd + 1, $areaadd);
            movehtm();
        }
        addnews($atime, 'addarea', $areaaddlist, $weather);
        systemputchat($atime, 'areaadd', $areaaddlist);
        check_addarea_gameover($atime);
    } else {
        return;
    }
}
开发者ID:winddramon,项目名称:dts,代码行数:32,代码来源:main.php

示例12: activate232

function activate232()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill232', 'player', 'logger', 'sys'));
    \player\update_sdata();
    if (!\skillbase\skill_query(232) || !check_unlocked232($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill232_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '技能冷却中!<br>';
        return;
    }
    \skillbase\skill_setvalue(232, 'lastuse', $now);
    $clv = \skillbase\skill_getvalue(232, 'lvl');
    $sc = $shieldgain[$clv];
    if ($hp < $mhp + $sc) {
        $hp = $mhp + $sc;
    }
    addnews(0, 'bskill232', $name);
    $log .= '<span class="lime">技能「力场」发动成功。</span><br>';
}
开发者ID:sillycross,项目名称:dts,代码行数:29,代码来源:main.php

示例13: activate247

function activate247()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('skill247', 'player', 'logger', 'sys'));
    \player\update_sdata();
    if (!\skillbase\skill_query(247) || !check_unlocked247($sdata)) {
        $log .= '你没有这个技能!<br>';
        return;
    }
    $st = check_skill247_state($sdata);
    if ($st == 0) {
        $log .= '你不能使用这个技能!<br>';
        return;
    }
    if ($st == 1) {
        $log .= '你已经发动过这个技能了!<br>';
        return;
    }
    if ($st == 2) {
        $log .= '技能冷却中!<br>';
        return;
    }
    $trapitem = array('itm' => '毒性【AC大逃杀革新企划书】', 'itmk' => 'TO', 'itme' => get_skill247_trap_eff(), 'itms' => 2, 'itmsk' => '');
    addnews(0, 'bskill247', $name);
    \trap\trap_use($trapitem);
    \trap\trap_use($trapitem);
    $log .= '<span class="lime">技能「挖坑」发动成功。</span><br>';
    \skillbase\skill_setvalue(247, 'lastuse', $now);
}
开发者ID:nahakyuu,项目名称:dts,代码行数:31,代码来源:main.php

示例14: 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, 'p') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/present.config.php';
        $plist = openfile($file);
        $rand = rand(0, count($plist) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist[$rand]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    } elseif (strpos($itmk, 'ygo') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/ygobox.config.php';
        $plist1 = openfile($file);
        $rand1 = rand(0, count($plist1) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    } elseif (strpos($itmk, 'fy') === 0) {
        $log .= "你打开了<span class=\"yellow\">{$itm}</span>。<br>";
        $file = __DIR__ . '/config/fybox.config.php';
        $plist1 = openfile($file);
        $rand1 = rand(0, count($plist1) - 1);
        list($in, $ik, $ie, $is, $isk) = explode(',', $plist1[$rand1]);
        $itm0 = $in;
        $itmk0 = $ik;
        $itme0 = $ie;
        $itms0 = $is;
        $itmsk0 = $isk;
        addnews($now, 'present', $name, $itm, $in);
        \itemmain\itms_reduce($theitem);
        \itemmain\itemget();
        return;
    }
    $chprocess($theitem);
}
开发者ID:winddramon,项目名称:dts,代码行数:59,代码来源:main.php

示例15: lottery_dohook

function lottery_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "newday":
            $numbers = get_module_setting("todaysnumbers");
            $n = $numbers;
            output("`n`@Today's lottery numbers are `^%s-%s-%s-%s`0`n", $n[0], $n[1], $n[2], $n[3]);
            $roundnum = get_module_setting("roundnum");
            $pround = get_module_pref("roundnum");
            if ($roundnum > $pround) {
                if (get_module_pref("pick") === $numbers) {
                    $prize = get_module_setting("prize");
                    if ($prize > "" && $pround < $roundnum) {
                        rawoutput("<font size='+1'>");
                        output("`\$You won today's lottery!`0`n");
                        rawoutput("</font>");
                        output("`\$The jackpot is `^^%s`\$ gold, money that has been deposited in to your bank account!`n", $prize);
                        $session['user']['goldinbank'] += $prize;
                        debuglog("won {$prize} gold on lottery");
                        addnews("`@%s`@ won `^%s`@ gold in the lottery!`0", $session['user']['name'], $prize);
                    }
                }
                set_module_pref("pick", "");
            }
            break;
        case "newday-runonce":
            $numbers = array();
            for ($i = 0; $i < 4; $i++) {
                $numbers[$i] = e_rand(0, 9);
            }
            sort($numbers);
            set_module_setting("todaysnumbers", join("", $numbers));
            $sql = "SELECT count(*) AS c FROM " . db_prefix("module_userprefs") . " WHERE modulename='lottery' AND setting='pick' AND value='" . join("", $numbers) . "'";
            $result = db_query($sql);
            $row = db_fetch_assoc($result);
            if ($row['c'] > 0) {
                //split the jackpot among winners.
                $prize = round(get_module_setting("currentjackpot") / $row['c'], 0);
                set_module_setting("prize", $prize);
                set_module_setting("currentjackpot", get_module_setting("basepot"));
                set_module_setting("howmany", $row['c']);
            } else {
                //the jackpot rolls over.
                set_module_setting("prize", 0);
                set_module_setting("howmany", 0);
            }
            set_module_setting("roundnum", get_module_setting("roundnum") + 1);
            break;
        case "inn":
            addnav("Things to do");
            addnav(array("%s`0's Lottery", getsetting('barkeep', '`tCedrik')), "runmodule.php?module=lottery&op=store");
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:56,代码来源:lottery.php


注:本文中的addnews函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。