本文整理汇总了PHP中increment_module_pref函数的典型用法代码示例。如果您正苦于以下问题:PHP increment_module_pref函数的具体用法?PHP increment_module_pref怎么用?PHP increment_module_pref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了increment_module_pref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wcgpoints_newdaystamina_dohook
function wcgpoints_newdaystamina_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "wcgpoints_increased":
if ($args['newpoints'] > 1) {
set_module_pref("daysleft", 5);
output("`0World Community Grid has updated your statistics, and you now have five game days of extra Stamina!`n`n");
}
break;
case "stamina-newday":
if (get_module_pref("daysleft")) {
output("`0Because you're helping to combat suffering with World Community Grid, your starting Stamina has been increased by ten per cent!`n`n");
increment_module_pref("daysleft", -1);
output("You have %s days of enhanced Stamina left. The counter is reset to five every time World Community Grid updates your statistics, which usually happens once every 24 hours.`n`n", get_module_pref("daysleft"));
require_once "modules/staminasystem/lib/lib.php";
addstamina(100000);
}
break;
case "wcg-features-desc":
output("`bStamina Boost`b: every time World Community Grid reports that you've earned some Cobblestones, you'll get an extra 10% of Stamina for five Game Days.`n`n");
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:25,代码来源:wcgpoints_newdaystamina.php
示例2: rationpack_use
function rationpack_use($args)
{
$full = get_module_pref("fullness", "staminafood");
if ($full >= 100) {
output("You pick up the ration pack, and eye it for a moment. Then, you put it right back where it was. You're `ifar`i too full to eat anything more for now.`n`n");
unset($args['destroyafteruse']);
unset($args['usetext']);
return $args;
}
//debug($args);
require_once "modules/staminasystem/lib/lib.php";
addstamina(100000);
increment_module_pref("fullness", 40, "staminafood");
increment_module_pref("fat", 40, "staminafood");
increment_module_pref("nutrition", 30, "staminafood");
if ($full < 0) {
output("You still feel as though you haven't eaten in days.`n`n");
}
if ($full >= 0 && $full < 50) {
output("You feel a little less hungry.`n`n");
}
if ($full >= 50 && $full < 100) {
output("You still feel as though you've got room for more!`n`n");
}
if ($full >= 100) {
output("You're stuffed! You feel as though you can't possibly eat anything more today.`n`n");
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:29,代码来源:rationpack.php
示例3: iitems_moduleprefs_dohook
function iitems_moduleprefs_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "iitems-use-item":
if ($args['master']['modulepref'] && $args['master']['modulepref_module'] && $args['modulepref_type']) {
$module = $args['master']['modulepref_module'];
$pref = $args['master']['modulepref'];
$val = $args['master']['modulepref_val'];
if ($args['master']['modulepref_type'] == "increment") {
increment_module_pref($pref, $val, $module);
} else {
if ($args['master']['modulepref_type'] == "set") {
set_module_pref($pref, $val, $module);
}
}
}
break;
case "iitems-superuser":
output("`bIItems: Module Prefs`b`n");
output("Alter module prefs upon use of the item. Good for modules where items could be used, but which don't support IItems yet.`n");
output("`bmodulepref`b - the name of the modulepref to alter.`n");
output("`bmodulepref_module`b - the name of the module to which this pref belongs.`n");
output("`bmodulepref_type`b - either \"increment\" or \"set\", for incrementing or setting moduleprefs.`n");
output("`bmodulepref_val`b - the value to set or increment.`n");
output("Example usage:`nmodulepref = availablestays | modulepref_module = inncoupons | modulepref_type = increment | modulepref_val = 5. Gives the player five free stays at the Inn when this item is used.`n`n");
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:items_creature_drop.php
示例4: energydrink_use
function energydrink_use($args)
{
require_once "modules/staminasystem/lib/lib.php";
$full = get_module_pref("fullness", "staminafood");
if ($full >= 100) {
output("You eye the bottle critically. Then, you put it right back where it was. You're `ifar`i too full to imbibe anything more for now.`n`n");
unset($args['destroyafteruse']);
unset($args['usetext']);
return $args;
}
addstamina(50000);
increment_module_pref("fullness", 5, "staminafood");
$full = get_module_pref("fullness", "staminafood");
if ($full < 0) {
output("You still feel as though you haven't eaten in days.`n`n");
}
if ($full >= 0 && $full < 50) {
output("You feel a little less hungry.`n`n");
}
if ($full >= 50 && $full < 100) {
output("You still feel as though you've got room for more!`n`n");
}
if ($full >= 100) {
output("You're stuffed! You feel as though you can't possibly eat anything more today.`n`n");
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:27,代码来源:energydrink.php
示例5: hunterslodge_specialcomments_small_use
function hunterslodge_specialcomments_small_use($args)
{
global $session;
increment_module_pref("commentsleft", 4, "specialcomments");
$left = get_module_pref("commentsleft", "specialcomments");
output("`0You now have `b%s`b Special Comments left to use.`n`n", $left);
return $args;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:8,代码来源:hunterslodge_specialcomments.php
示例6: pub_newpittsburgh_drinks_dohook
function pub_newpittsburgh_drinks_dohook($hookname, $args)
{
global $session;
$drinks = array("brainhem" => array("price" => 35, "verbosename" => "Brain Hemorrhage"), "monstermash" => array("price" => 50, "verbosename" => "Monster Mash"), "specialsauce" => array("price" => 65, "verbosename" => "Special Sauce"));
switch ($hookname) {
case "pub_newpittsburgh_bartender":
if ($session['user']['race'] == "Robot") {
if ($session['user']['sex']) {
$lovelad = "lad";
} else {
$lovelad = "love";
}
$args['text']['hello'] = "George looks you up and down, eyes sliding over your smooth glass skin. \"`2You're a Robot, aren't you, " . $lovelad . "?`0\"`n`n\"`#That I am. Are you going to tell me that you don't serve my type in here?`0\"`n`n\"`2On the contrary, Chuck, we'd be `ivery`i pleased to cater to our Robot customers, but we just don't have the power, y'see. Setting up one of those fancy lamps just takes more amps than our genny can kick out. You ask most of the pubs on the Island, it's the same way.`0\"`n`n\"`#I see.`0\"`n`n\"`2We've got games, though. And telly. You're more than welcome here, it's just...`0\" he shrugs his shoulders and spreads his hands. \"`2I don't have anything to sell you that you'd want to buy.`0\"`n`n`#Fair enough`0, you suppose.";
} else {
$args['drinks'] = $drinks;
}
break;
case "pub_newpittsburgh_drink":
$drink = httpget("drink");
switch ($drink) {
case "brainhem":
$session['user']['gold'] -= 35;
output("\"`2All right Chuck,`0\" says George, bringing up a jar of pickled brains. They look far too small to be human, even pickled - perhaps the size of rabbit brains. The wrinkled grey things bob peacefully around as George carefully pours a measure of the fluid into a shot glass with the help of a funnel.`n`nThe liquid smells a lot like embalming fluid.`n`nTastes like it, too, albeit with a nice alcoholic glow.`n`n");
output("You feel `2Energetic!`0`n`n");
apply_buff('pub_newpittsburgh_brainhem', array("name" => "`2Brain Hemorrhage Fuzzies", "rounds" => 15, "defmod" => 1.12, "roundmsg" => "Thanks to your Brain Hemorrhage Fuzzies, your defensive movements are more fluid!", "wearoff" => "You feel the effects of the Brain Hemorrhage fade away.", "schema" => "pub_newpittsburgh"));
//require_once "modules/staminasystem/lib/lib.php";
//addstamina(5000);
break;
case "monstermash":
$session['user']['gold'] -= 50;
output("George hands you a tall glass filled with artfully-swirled monster grey matter, garnished with a jolly little paper umbrella and a slice of brainstem.`n`n");
if ($session['user']['race'] != "Zombie") {
output("You take a sip. It's... honestly, it's awful. It tastes like a mix of chicken and beef fat, raw eggs, and blood. Lots of blood. Not meaning to be impolite you knock the glass back quickly, trying to ignore the cold, semi-solid lumps slowly sliding over your tongue and curling down your throat.`n`n");
output("You feel `4Sick and Grumpy!`0`n`n");
apply_buff('pub_newpittsburgh_monstermash', array("name" => "`2Monster Mash Grumps", "rounds" => 25, "atkmod" => 1.2, "roundmsg" => "`4The awful Zombie drink makes you feel `\$aggressive!", "wearoff" => "`4You feel the effects of the Monster Mash fade away. Thank goodness for that.", "schema" => "pub_newpittsburgh"));
//require_once "modules/staminasystem/lib/lib.php";
//addstamina(5000);
} else {
output("You down the contents and lick your lips.`n`n");
output("You feel `2Energetic!`0`n`n");
//require_once "modules/staminasystem/lib/lib.php";
//addstamina(10000);
increment_module_pref("nutrition", 5, "staminafood");
apply_buff('pub_newpittsburgh_monstermash', array("name" => "`2Monster Mash", "rounds" => 25, "atkmod" => 1.2, "defmod" => 1.1, "roundmsg" => "`2The Monster Mash burns warmly in your stomach. Both your attack and defence are increased!", "wearoff" => "`2The Monster Mash warmth has faded. Oh well.", "schema" => "pub_newpittsburgh"));
}
break;
case "specialsauce":
$session['user']['gold'] -= 65;
output("George pours you a short glass full of something from a thick blue bottle. It's the only thing on the menu that doesn't mention brains, though you wonder if the odd blue liquid wasn't distilled from them. It smells vaguely of formaldehyde, but has enough of a tongue-numbing alcoholic kick that you don't regret ordering it.`n`n");
output("You feel `2Warm!`0`n`n");
apply_buff('pub_newpittsburgh_specialsauce', array("name" => "`2Special Sauce Warmth", "rounds" => 30, "defmod" => 1.25, "atkmod" => 1.25, "roundmsg" => "That Zombie drink was awesome! It's like time's slowed down!", "wearoff" => "You feel the effects of the Special Sauce fade away.", "schema" => "pub_newpittsburgh"));
break;
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:57,代码来源:pub_newpittsburgh_drinks.php
示例7: referral_bonus_dohook
function referral_bonus_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "newday":
if (get_module_pref("days") >= get_module_setting("daysperbonus")) {
increment_module_pref("days");
$sql = "UPDATE " . db_prefix("accounts") . " SET donation=donation+" . get_module_setting("pointsperbonus") . " WHERE acctid={$session['user']['referer']}";
db_query($sql);
clear_module_pref("days");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:15,代码来源:referral_bonus.php
示例8: pktrack_dohook
function pktrack_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "charstats":
if (get_module_pref("user_showpk") == 1) {
if (get_module_setting("wo") == 0) {
$title = translate_inline("Vital Info");
}
if (get_module_setting("wo") == 1) {
$title = translate_inline("Personal Info");
}
if (get_module_setting("wo") == 2) {
$title = translate_inline("Extra Info");
}
$name = translate_inline("Player Kills");
$count = get_module_pref("count");
setcharstat($title, $name, $count);
}
break;
case "pvpwin":
debug($args);
if ($args['options']['type'] == 'pvp') {
increment_module_pref("count");
}
break;
case "pvploss":
if (!get_module_setting("losses")) {
break;
}
debug($args);
if ($args['options']['type'] == 'pvp') {
increment_module_pref("count", 1, "pktrack", $args['badguy']['acctid']);
}
break;
case "biostat":
$char = $args['acctid'];
$cpk = get_module_pref("count", "pktrack", $char);
output("`^Player Kills: `@%s`0", $cpk);
output_notl("`n");
break;
case "footer-hof":
addnav("Warrior Rankings");
addnav("Player Kills", "runmodule.php?module=pktrack&op=hof");
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:48,代码来源:pktrack.php
示例9: iitems_edibles_dohook
function iitems_edibles_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "iitems-use-item":
if ($args['master']['edible']) {
$full = get_module_pref("fullness", "staminafood");
if ($full >= 100) {
output("You pick up the tasty morsel, and eye it for a moment. Then, you put it right back where it was. You're `ifar`i too full to eat anything more for now.`n`n");
unset($args['master']);
unset($args['player']);
$args['player']['break_use_operation'] = 1;
} else {
increment_module_pref("fat", $args['master']['edibles_fat'], "staminafood");
increment_module_pref("nutrition", $args['master']['edibles_nutrition'], "staminafood");
increment_module_pref("fullness", $args['master']['edibles_fullness'], "staminafood");
}
}
break;
case "iitems-use-item-after":
if ($args['master']['edible']) {
$full = get_module_pref("fullness", "staminafood");
if ($full < 0) {
output("You still feel as though you haven't eaten in days.`n`n");
}
if ($full >= 0 && $full < 50) {
output("You feel a little less hungry.`n`n");
}
if ($full >= 50 && $full < 100) {
output("You still feel as though you've got room for more!`n`n");
}
if ($full >= 100) {
output("You're stuffed! You feel as though you can't possibly eat anything more today.`n`n");
}
}
break;
case "iitems-superuser":
output("`bIItems: Edible IItems`b. Remember to set a value for Stamina as well. Remember also that this is only for use with simple edible items that can't be used for other purposes - for example, an apple that can be thrown at an enemy or consumed will require an extension script, and the 'edible' param shouldn't be used in cases like this.`n");
output("`bedible`b - Set this to enable Edible Items functionality.`n");
output("`bedibles_nutrition`b - Increase player's Nutrition.`n");
output("`bedibles_fat`b - Increase player's Fat.`n");
output("`bedibles_fullness`b - Increase player's Fullness.`n`n");
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:46,代码来源:iitems_edibles.php
示例10: emilybundle_run
function emilybundle_run()
{
global $session;
$op = httpget("op");
page_header("The Emily Bundle");
$cost = get_module_setting("cost");
$stock = get_module_setting("stock");
$playerpoints = $session['user']['donation'] - $session['user']['donationspent'];
switch ($op) {
case "start":
output("So, Improbable Island has been going for a couple of years now and it's turning into something that can keep me alive and with a roof over my head without me having to do website design. It's turned from a hobby into a full-time job.`n`nSince then, I've gotten married, and my wife, Emily(*), has gotten increasingly frustrated with her job. She does database work for a hospital; the pay's good, but the hours and the work itself is pretty depressing.`n`nI've noticed lately that my original goal - \"Hey, I'll write a text adventure game!\" - hasn't quite worked out the way I wanted it to, because I thought it'd be about writing. I figured I'd have a plot, decent characters, a beginning, middle and end - you know, a story. But lately I've been doing a lot more building of games and systems than I have building of worlds, and I'm beginning to realise that that's what I'm good at.`n`nThe Island needs a writer.`n`nA dedicated writer, so that I can be a dedicated coder. Recently I've done all sorts of stuff with Titans, Onslaught, new Commentary, Dwellings, and all that jazz - but the last actual piece of world-building writing that I did was in Common Ground, with its time-sensitive description text. I believe that was before Christmas.`n`nOh, and there were some lions, too.`n`nTo give you an idea of where I am right now, let's say this: the system is in place to extend that level of time-and-context-sensitive detail to every Outpost. I just don't have any writing to go in the system.`n`nIt's not that I don't like writing, and forgive me for parping my own horn but I don't think it's that I'm not good at it (although that sentence may have been evidence to the contrary). It's just that I have so much else to do.`n`nI need help.`n`nHey, you know... my wife is an excellent writer.`n`nHonestly I'd be doing this before too long even if I didn't need Emily to help me with the Island. She hates her job, I love mine, and that's unfair; it's imperative that the Island support both of us if we ever want to have our own house, or raise a family.`n`nWe've done our maths and figured out how much we need per month on which to survive without Emily's workplace sorting out our health insurance (that's the biggest expense, right there), and from that, based on historical data, we've figured out how much of an advertisement boost we'd need to get the Island up to that sort of level, and from that, how much money we'd need to get together by 'x' if we want Emily to be able to quit her job by 'y', with 'y' being \"Before September.\"`n`nIn a nutshell we need to get some bread together so that we can expand our player base enough that casual everyday donations cover us both without me having to tell you all about it every time my laptop breaks, my car breaks down, or my lion gets into an argument he just can't win.`n`nSo, you can give me money so that the Island can have more juicy plot points and a better sense of place, or you can give me money so that Emily and I can be happier and spend more time together. Both are excellent reasons. I've got another reason for you:`n`nIntroducing the `5Emily Bundle`0!`n`nThe `5Emily Bundle`0 costs 2,500 Donator Points, and it's worth well over three times as much. In the Emily Bundle for 2,500 Donator Points (that's twenty-five bucks, for those of you keeping track), you get:`n`n* Permanent, unlimited free Avatar picture changes (never pay to change your Avatar picture again!)`n* Permanent, unlimited free Custom Weapon changes (custom weaponry now sticks around properly!)`n* Permanent, unlimited free Custom Armour changes (likewise!)`n* Permanent, unlimited free Custom Name Colour changes`n* Permanent, inlimited free Title changes`n* Permanent, unlimited free Mount Name changes`n* Permanent, unlimited free Commentary Race Name changes`n* Ten cigarettes`n* Ten thousand Requisition tokens`n* Two extra Chronospheres`n* All your current Chronospheres refilled`n* Ten Special Comments`n* A special, strictly-limited-and-not-to-be-repeated Medal`n`nAnd if you've not already donated, you'll also get room for a ten-thousand character Extended Bio (players who've already donated already have this).`n`nNow, the Emily Bundle is limited to two hundred players. That should give Emily and I enough of a financial boost to get this plan underway. If something stupidly awesome happens like the whole stock running out in a day, then I might add another fifty or a hundred or so, but no more than that (I'm not going to say it's strictly limited just to stimulate demand and then make it as common as muck - I want this to be a bit special).`n`nSo, help us recruit a writer and make the Island more awesome, more quickly - grab the Emily Bundle while it's still around to grab!`n(*) Yes, I named the pickle-wench barmaid after my wife. Looking back, I could have made a better choice for an homage.");
addnav("Buy the Emily Bundle!");
if ($playerpoints >= $cost) {
addnav("Yes! (2,500 points)", "runmodule.php?module=emilybundle&op=buy");
} else {
addnav(array("Just %s more points!", $cost - $playerpoints), "");
}
break;
case "buy":
set_module_pref("permanent", true, "commentaryicons_customrace");
set_module_pref("permanent", true, "titlechange");
set_module_pref("permanent", true, "namedmount");
set_module_pref("permanent", true, "namecolor");
set_module_pref("permanent", true, "avatar");
set_module_pref("permanentarmor", true, "customeq");
set_module_pref("permanentweapon", true, "customeq");
$session['user']['gems'] += 10;
$session['user']['goldinbank'] += 10000;
$curspheres = get_module_pref("slots", "daysave");
set_module_pref("slots", $curspheres + 2, "daysave");
set_module_pref("days", $curspheres + 2, "daysave");
increment_module_pref("commentsleft", 10, "specialcomments");
require_once "modules/medals.php";
medals_award_medal("emilybundle", "Emily Bundle Supporter", "This player bought the Emily Bundle, supporting Improbable Island and its admin!", "medal_emilybundle.png");
$session['user']['donationspent'] += $cost;
increment_module_setting("stock", -1);
set_module_pref("bought", 1);
output("You've got the Emily Bundle! Thank you so much for supporting the Island. Have fun!`n`n");
//todo: medal, take points, diminish stock, output thankyou
break;
}
addnav("Return");
addnav("L?Return to the Lodge", "lodge.php");
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:45,代码来源:emilybundle.php
示例11: monsterkills_dohook
function monsterkills_dohook($hookname, $args)
{
global $session, $badguy;
switch ($hookname) {
case "dragonkill":
if (get_module_setting("reset")) {
set_module_pref("kills", 0, "monsterkills");
}
break;
case "footer-hof":
addnav("Warrior Rankings");
addnav("Most Monster Kills", "runmodule.php?module=monsterkills");
break;
case "battle-victory":
if ($args['type'] == "forest") {
increment_module_pref("kills");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:monsterkills.php
示例12: implantsleepsuppression_dohook
function implantsleepsuppression_dohook($hookname, $args)
{
global $session, $resline;
$spec = "SS";
$name = "Sleep Suppression System";
$ccode = "`2";
switch ($hookname) {
case "choose-specialty":
if ($session['user']['specialty'] == "" || $session['user']['specialty'] == '0') {
if ($session['user']['dragonkills'] >= 1) {
addnav("Sleep Suppression System", "newday.php?setspecialty=SS{$resline}");
output("`5\"This is a `2Sleep Suppression System`5 implant. This one doesn't have any interactive effects, like other Implants that may be designed for combat or travel or what-have-you - it simply suppresses the release of certain chemicals that cause tiredness. In a nutshell, you'll start to feel tired much later in the day than you would normally - you'll crash a lot faster, but you'll get more time being fully awake. It's a tradeoff, really.\"`n`n");
}
}
break;
case "set-specialty":
if ($session['user']['specialty'] == "SS") {
page_header("Sleep Suppression System");
output("`2Inside your head is an Implant designed to keep you alert for longer.`n`nThe point at which you start eating into Amber stamina has been reduced.");
}
break;
case "specialtycolor":
$args[$spec] = $ccode;
break;
case "specialtynames":
$args[$spec] = translate_inline($name);
break;
case "specialtymodules":
$args[$spec] = "implantsleepsuppression";
break;
case "stamina-newday":
if ($session['user']['specialty'] == "SS") {
increment_module_pref("amber", -100000, "staminasystem");
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:38,代码来源:implantsleepsuppression.php
示例13: supplycrate_use
function supplycrate_use($args)
{
increment_module_pref("cratesopened", 1, "supplycrates");
$found = get_module_pref("cratesopened", "supplycrates");
if (is_module_active("medals")) {
if ($found > 250) {
require_once "modules/medals.php";
medals_award_medal("crate1000", "Supreme Crate Finder", "This player has opened more than 250 Supply Crates!", "medal_crategold.png");
}
if ($found > 50) {
require_once "modules/medals.php";
medals_award_medal("crate500", "Expert Crate Finder", "This player has opened more than 50 Supply Crates!", "medal_cratesilver.png");
}
if ($found > 10) {
require_once "modules/medals.php";
medals_award_medal("crate100", "Supreme Crate Finder", "This player has opened more than 10 Supply Crates!", "medal_cratebronze.png");
}
}
$crateables = get_items_with_settings("cratefind");
$randompool = array();
foreach ($crateables as $item => $prefs) {
for ($i = 0; $i < $prefs['cratefind']; $i++) {
$randompool[] = $item;
}
}
output("You spend a few minutes prying open your Supply Crate.`n");
$giveitems = array();
$numitems = e_rand(get_module_setting("minitems", "supplycrates"), get_module_setting("maxitems", "supplycrates"));
$chosenitems = array_rand($randompool, $numitems);
foreach ($chosenitems as $key => $poolkey) {
$item = $randompool[$poolkey];
$name = $crateables[$item]['verbosename'];
output("You find a %s!`n", $name);
give_item($item);
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:37,代码来源:supplycrate.php
示例14: timedcombat_teach_dohook
function timedcombat_teach_dohook($hookname, $args)
{
global $session, $last_timestamp;
switch ($hookname) {
case "newday":
set_module_pref("taughttoday", 0);
break;
case "biostat":
if (httpget('op') == "teachtimedcombat") {
set_module_pref("able", true, "timedcombat", $args['acctid']);
debug(get_module_pref("able", "timedcombat", $args['acctid']));
set_module_pref("taughttoday", 1);
increment_module_pref("taught");
output("`bYou have successfully taught this character how to do Timed Combat!`b`n");
if (is_module_active("medals")) {
require_once "modules/medals.php";
medals_award_medal("timedcombat_teach", "Time Tutor", "This player taught another player how to do Timed Combat!", "medal_timeteacher.png");
}
require_once "lib/systemmail.php";
$subj = $session['user']['name'] . " taught you a new skill!";
$body = "You can now perform Timed Combat in fights! If you time your fight commands correctly, you'll get a double-attack and double-defence bonus! The bonus applies to everything you do in combat. Try timing your five-round auto-fights - one correct hit wins you five rounds of extra power, and the same goes for ten-round auto-fighting too! If you don't want to muck about with counting under your breath, you can ignore the new skill and carry on fighting as you've always done. Get four perfect hits in a row and you can teach other players! Have fun!";
systemmail($args['acctid'], $subj, $body);
}
$ret = httpget('ret');
if ($args['acctid'] != $session['user']['acctid'] && !get_module_pref("taughttoday") && get_module_pref("maxchain", "timedcombat") >= 4) {
//get the players' chat locations from commentaryinfo.php - it's handy!
$tloc = get_module_pref("loc", "commentaryinfo");
$sloc = get_module_pref("loc", "commentaryinfo", $args['acctid']);
if ($tloc == $sloc && !get_module_pref("able", "timedcombat", $args['acctid'])) {
output("This player doesn't know how to do Timed Combat. You can teach one student per game day.`n`n");
addnav("Teach this player the Timed Combat skill", "bio.php?op=teachtimedcombat&char=" . $args['acctid'] . "&ret=" . urlencode($ret));
}
}
break;
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:37,代码来源:timedcombat_teach.php
示例15: human_loot_run
function human_loot_run()
{
global $session;
page_header("The Procurement of Appurtenances");
if (get_module_pref("itemstaken") <= 3 && httpget("give")) {
debug(get_module_pref("itemstaken"));
give_item(httpget("give"));
increment_module_pref("itemstaken");
}
debug(get_module_pref("itemstaken"));
switch (get_module_pref("itemstaken")) {
case 0:
output("\"`1Ah. Yes, I don't believe you've had your standard equipment issue today. Well, let's get started, then.`0\" The man sets his newspaper down, and counts on his fingers. \"`1We've got BANG Grenades, ZAP Grenades, WHOOMPH Grenades, Small Medkits and Ration Packs. You can have any three items you like.`0\"`n`nHe unselfconsciously goes back to reading his newspaper while you make up your mind.");
break;
case 1:
output("\"`1Okay.`0\" The man reaches under his desk and brings up your chosen item, without taking his hands off the newspaper. \"`1Two more.`0\"");
break;
case 2:
output("\"`1Right-ho.`0\" The man once again reaches under his desk and brings up your chosen item. You wonder if he would even notice if someone else came in and took your place. \"`1Last one, now.`0\"");
break;
case 3:
output("\"`1Right, there we are.`0\" The man plonks your chosen item down next to the others. \"`1Have a nice day, and try not to get killed.`0\"");
break;
}
if (get_module_pref("itemstaken") < 3) {
addnav("Gimme a...");
addnav("BANG Grenade", "runmodule.php?module=human_loot&give=banggrenade");
addnav("WHOOMPH Grenade", "runmodule.php?module=human_loot&give=whoomphgrenade");
addnav("ZAP Grenade", "runmodule.php?module=human_loot&give=zapgrenade");
addnav("Small Medkit", "runmodule.php?module=human_loot&give=smallmedkit");
addnav("Ration Pack", "runmodule.php?module=human_loot&give=rationpack");
} else {
addnav("Out you go, then.");
addnav("Leave", "village.php");
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:37,代码来源:human_loot.php