本文整理汇总了PHP中give_item函数的典型用法代码示例。如果您正苦于以下问题:PHP give_item函数的具体用法?PHP give_item怎么用?PHP give_item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了give_item函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rail_peddler_run
function rail_peddler_run()
{
global $session, $inventory;
$op = httpget("op");
$loc = rail_peddler_getloc();
$hid = $loc["peddlerhid"];
$rid = $loc["peddlerrid"];
$price = get_module_setting("peddlerprice");
if ($op == "buy") {
$headertext = "Why sure, I'll take one of those!";
} else {
$headertext = "Go away, I'm busy.";
}
page_header($headertext);
switch ($op) {
case "buy":
output("The scruffy vendor's eyes gleam. Was that a fla`gs`0h of green, or no? \"`2Verra wise, %s. Ye willna be sorry!`0\"`n`n", translate_inline($session['user']['sex'] ? 'lass' : 'lad'));
give_item("cardcase");
// if (!$success){
// output("Then -- a frown. \"`2Wait, no, I canna sell t'ye. Ye'd better petition the Big Boss, tell 'im t'see what's gaen wrong wiv all dis.`0\"`n`n");
// } else {
output("You have a fine leather card case. Pleased, you admire its soft texture. What an excellent purchase you have made!`n`n");
// }
$session['user']['gems'] -= $price;
break;
case "pass":
output("\"`2Bleedin' smart-arse.`0\" The scruffy vendor shrugs and goes off to pester someone else.`n`n");
break;
}
addnav("Back to the Concourse", "runmodule.php?module=improbablehousing&op=interior&hid={$hid}&rid={$rid}");
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:rail_peddler.php
示例2: hunterslodge_selectionbox_use
function hunterslodge_selectionbox_use($args)
{
global $session;
//give all the items in the Selection Box
//eboy's items
for ($i = 0; $i < 2; $i++) {
give_item("banggrenade");
give_item("cratesniffer");
give_item("energydrink");
give_item("improbabilitybomb");
give_item("largemedkit");
give_item("monsterrepellentspray");
give_item("nicotinegum");
give_item("oneshotteleporter");
give_item("rationpack");
give_item("smallmedkit");
give_item("whoomphgrenade");
give_item("zapgrenade");
}
//lodge items
give_item("buildersbrew");
give_item("hunterslodge_avatar");
give_item("hunterslodge_cigs_small");
give_item("hunterslodge_customarmour");
give_item("hunterslodge_customcolours");
give_item("hunterslodge_customrace");
give_item("hunterslodge_customtitle");
give_item("hunterslodge_customweapon");
give_item("hunterslodge_namedmount");
give_item("hunterslodge_req_small");
give_item("hunterslodge_specialcomments_small");
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:33,代码来源:hunterslodge_selectionbox.php
示例3: hunterslodge_selectionbox_builder_use
function hunterslodge_selectionbox_builder_use($args)
{
global $session;
//give all the items in the Selection Box
for ($i = 0; $i < 10; $i++) {
give_item("buildersbrew");
give_item("monsterrepellentspray");
give_item("oneshotteleporter");
give_item("rationpack");
give_item("energydrink");
}
give_item("hunterslodge_cigs_large");
give_item("hunterslodge_cigs_large");
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:15,代码来源:hunterslodge_selectionbox_builder.php
示例4: supplycrates_dohook
function supplycrates_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "donation":
$amt = $args['amt'];
$donationbonus = floor($args['amt'] / get_module_setting("donationaddition"));
$xmax = get_module_setting("worldmapsizeX", "worldmapen");
$ymax = get_module_setting("worldmapsizeY", "worldmapen");
for ($i = 0; $i < $donationbonus; $i++) {
$x = e_rand(1, $xmax);
$y = e_rand(1, $ymax);
$owner = "worldmap_" . $x . "," . $y . ",1";
give_item("supplycrate", false, $owner);
}
break;
}
return $args;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:19,代码来源:supplycrates.php
示例5: hunterslodge_selectionbox_eboy_use
function hunterslodge_selectionbox_eboy_use($args)
{
global $session;
//give all the items in the Selection Box
//eboy's items
for ($i = 0; $i < 2; $i++) {
give_item("banggrenade");
give_item("cratesniffer");
give_item("energydrink");
give_item("improbabilitybomb");
give_item("largemedkit");
give_item("monsterrepellentspray");
give_item("nicotinegum");
give_item("oneshotteleporter");
give_item("rationpack");
give_item("smallmedkit");
give_item("whoomphgrenade");
give_item("zapgrenade");
}
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:hunterslodge_selectionbox_eboy.php
示例6: 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
示例7: 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
示例8: items_world_map_gathering_run
function items_world_map_gathering_run()
{
global $session;
page_header("Gathering Materials");
$type = httpget('mat');
$item = httpget('item');
require_once "modules/staminasystem/lib/lib.php";
if ($type == "wood") {
$lv = process_action("Logging");
$stam = get_stamina();
$rstam = get_stamina(0);
$failchance = e_rand(0, 99);
if ($failchance < $stam) {
give_item("wood");
use_item($item, "logging");
output("`0You hack away until you have what can only be described as a bloody enormous log, suitable as a part of a quaint little cabin. It couldn't possibly fit into your backpack, but you stuff it in anyway.`n");
if ($lv['lvlinfo']['levelledup'] == true) {
output("`n`c`b`0You gained a level in Logging! You are now level %s! This action will cost fewer Stamina points now, so you can lumberjack more lumber each day!`b`c`n", $lv['lvlinfo']['newlvl']);
}
} else {
if ($failchance < $rstam) {
output("You hack away until you have what can only be described as a whole shitload of matchsticks. The wood just splintered into barely more than pulp under your clumsy, half-asleep paws.`n`nMaybe it'd be a good idea to rest a bit before you try this again.`n`n");
} else {
$fail = 1;
output("You hack away at the tree, your half-asleep mind blissfully ignorant of its wild swaying. Ignorant, that is, until it falls on you.`n`nYou wake up, naturally, on the FailBoat.`n`n");
}
}
} else {
if ($type == "stone") {
$lv = process_action("Stonecutting");
$stam = get_stamina();
$rstam = get_stamina(0);
$failchance = e_rand(0, 99);
if ($failchance < $stam) {
$success = 1;
give_item("stone");
use_item($item, "stonecutting");
output("`0You hack away until you have what can only be described as a huge-ass lump of stone, very heavy and cumbersome. For some reason your backpack seems like a really good place to put it.`n");
if ($lv['lvlinfo']['levelledup'] == true) {
output("`n`c`b`0You gained a level in Stonecutting! You are now level %s! This action will cost fewer Stamina points now, so you can break more rocks each day!`b`c`n", $lv['lvlinfo']['newlvl']);
}
} else {
if ($failchance < $rstam) {
output("You hack away until you have what can only be described as a whole shitload of gravel. The rock just smashed into splinters under your clumsy, half-asleep paws.`n`nMaybe it'd be a good idea to rest a bit before you try this again.`n`n");
} else {
$fail = 1;
output("You hack away at the rock, blissfully unaware that another, larger rock is being gently dislodged by your half-asleep ministrations. Another, larger rock that happens to be balanced precariously on an outcrop just above your head.`n`nYou wake up, naturally, on the FailBoat.`n`n");
}
}
}
}
if (!$fail) {
items_world_map_gathering_showgather();
addnav("Other");
addnav("Show Inventory", "inventory.php?items_context=worldmap");
addnav("Return to the World Map", "runmodule.php?module=worldmapen&op=continue");
} else {
$session['user']['hitpoints'] = 0;
$session['user']['gold'] = 0;
$session['user']['alive'] = 0;
//set the user's location to the last place on the map they touched
$session['user']['location'] = get_module_pref("lastCity", "worldmapen");
addnav("Guess what happens now?");
addnav("That's right.", "shades.php");
}
page_footer();
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:67,代码来源:items_world_map_gathering.php
示例9: eboy_run
function eboy_run()
{
global $session, $inventory;
if (!isset($inventory)) {
load_inventory();
}
page_header("eBoy's Trading Station");
addnav("Buy Items");
addnav("Sell Items");
require_once "modules/cityprefs/lib.php";
$cid = get_cityprefs_cityid("location", $session['user']['location']);
$item = httpget('item');
if ($item) {
$curstock = get_item_setting("eboy_stock_" . $cid, $item);
$curprice = get_item_setting("eboy_price_" . $cid, $item);
}
eboy_updateprices();
$eboy_info = get_items_with_settings("eboy");
if (httpget('op') == "start") {
output("Already fearing the worst, you head into eBoy's Trading Station.`n`nYour fears are well-founded. The place is packed with the heaving, sweaty bodies of the hardcore capitalist, shouting \"`iBuy, buy!`i\" and \"`iSell, sell!`i\" and \"`iPut down the chainsaw and let's talk about this!`i\"`n`neBoy himself - although you suspect that this place, like Mike's Chop Shop, is a franchise of which you'll find one in every outpost, so is his name really eBoy? Whoever he is, he stands on an elevated section of floor behind a tall mahogany counter, grabbing money with one hand and tossing grenades and ration packs over his shoulder with the other. His arms are a blur. His speech is the unintelligible, rapid-fire gabble of a professional auctioneer. His eyes bulge and swivel. You know he's loving this.`n`n");
}
if (httpget('op') == "buy") {
$pprice = httpget('price');
if ($pprice == $curprice) {
if ($curstock > 0) {
give_item($item);
$session['user']['gold'] -= $curprice;
increment_item_setting("eboy_stock_" . $cid, -1, $item);
output("You fight your way to the front of the crowd and shout your order up to eBoy, slapping your Requisition tokens down on the counter. Before you can blink, your money is gone and the item you desired sits in its place. You grab it hastily and stuff it into your backpack as eBoy turns to deal with the next customer.`n`n");
} else {
output("eBoy turns to you and gibbers.`n`n\"Sorrymatejustsoldthelastoneyougottabefasteritsthequickandthedeadaroundherepal.\" He turns to the next customer in line, leaving you trying to piece together whatever it is that he just said.`n`n");
}
} else {
output("You fight your way to the front of the crowd and shout your order up to eBoy, slapping your Requisition tokens down on the counter. eBoy turns to you and gibbers.`n`n\"Idontmeantobefunnymatebutlookattheboardthepricehasjustbloodychangedagainyousureyoustillwannabuy?\" After giving you exactly one microsecond to consider what the hell he just asked, he rolls his eyes and turns to the next customer in line.`n`n");
}
}
if (httpget('op') == "sell") {
$pprice = httpget('price');
$requiredprefs = array("inventorylocation" => "main");
$itemid = has_item($item, $requiredprefs);
if ($pprice == $curprice) {
delete_item($itemid);
if ($curstock < 3) {
$buy = round($curprice * 0.5);
} else {
$buy = round($curprice * 0.7);
}
$session['user']['gold'] += $buy;
increment_item_setting("eboy_stock_" . $cid, 1, $item);
output("You barge your way through the crowd like a battleship through an ice floe, and toss your item up to eBoy. eBoy snatches the item out of the air with his left hand while tossing your Requisition tokens back at you with his right, and goes on to serve the next customer.`n`n");
} else {
output("You fight your way to the front of the crowd and shout your order up to eBoy, slapping your Requisition tokens down on the counter. eBoy turns to you and gibbers.`n`n\"Idontmeatobefunnymatebutlookattheboardthepricehasjustbloodychangedagainyousureyoustillwannasell?\" After giving you exactly one microsecond to consider what the hell he just asked, he rolls his eyes and turns to the next customer in line.`n`n");
}
}
output("You look up above eBoy's head at the trading board, the values of each commodity displayed on a mechanical readout which clatters and changes constantly.`n`n");
$sellable_inventory = array();
foreach ($inventory as $itemid => $prefs) {
if (!$prefs['carrieritem'] && $prefs['eboy'] && $prefs['inventorylocation'] == "main") {
$sellable_inventory[$prefs['item']]['quantity'] += 1;
$sellable_inventory[$prefs['item']]['itemids'][] = $itemid;
}
}
eboy_updateprices();
$eboy_info = get_items_with_settings("eboy");
//inventory-type display routine
rawoutput("<table width=100% style='border: dotted 1px #000000;'>");
$classcount = 1;
foreach ($eboy_info as $item => $settings) {
if ($settings['eboy_stock_' . $cid] > 0) {
$stock = number_format($settings['eboy_stock_' . $cid]) . " available";
} else {
$stock = "`4Sold Out`0";
}
$classcount++;
$class = $classcount % 2 ? "trdark" : "trlight";
rawoutput("<tr class='{$class}'><td>");
if ($settings['image']) {
rawoutput("<table width=100% cellpadding=0 cellspacing=0><tr><td width=100px align=center><img src=\"images/items/" . $settings['image'] . "\"></td><td>");
}
output("`b%s`b`n", stripslashes($settings['verbosename']));
output("%s`n", stripslashes($settings['description']));
if ($settings['weight']) {
output("Weight: %s kg`n", $settings['weight']);
}
rawoutput("<table width=100%><tr><td width=50%>");
output("`bStock:`b %s", $stock);
if ($settings['eboy_stock_' . $cid] < 3) {
$buy = round($settings['eboy_price_' . $cid] * 0.5);
} else {
$buy = round($settings['eboy_price_' . $cid] * 0.7);
}
if ($settings['eboy_price_' . $cid] > 0) {
output("`n`7Buying at: %s Requisition", number_format($buy));
} else {
output("`nNot Buying");
}
if ($settings['eboy_stock_' . $cid] > 0) {
output("`n`2Selling at: %s Requisition`n`n", number_format($settings['eboy_price_' . $cid]));
} else {
output("`n`n");
//.........这里部分代码省略.........
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:eboy.php
示例10: giftbox_use
function giftbox_use($args)
{
global $session;
debug($args);
$cname = get_item_pref("verbosename", $args['giftbox_contains']);
output("`0You open up the box to find a %s!`0`n`n", $cname);
if (get_item_pref("inventorylocation", $args['giftbox_contains']) == "lodgebag") {
if (!has_item("lodgebag")) {
give_item("lodgebag");
}
} else {
clear_item_pref("inventorylocation", $args['giftbox_contains']);
}
change_item_owner($args['giftbox_contains'], $session['user']['acctid']);
return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:16,代码来源:giftbox.php
示例11: giftstation_run
function giftstation_run()
{
global $session;
page_header("The Gifting Station");
$op = httpget('op');
$points = $session['user']['donation'] - $session['user']['donationspent'];
switch ($op) {
case "start":
if (httpget("subop") == "continue") {
output("The KittyMorph shows you a big smile. \"`1Okay, that'll be delivered first thing in the morning. Should make for a nice surprise when they wake up. Anyone else you'd like to send a gift to?`0\"`n`n");
$player = httpget('player');
$itemid = httpget('item');
$box = httpget('box');
$free = httpget('free');
$anonymous = httpget('anonymous');
$boxid = give_item($box, false, "giftstation_" . $player);
// debug($boxid);
// debug($itemid);
change_item_owner($itemid, $boxid);
set_item_pref("giftbox_contains", $itemid, $boxid);
if (!$anonymous) {
$desc = get_item_pref("description", $boxid);
$desc .= "`nThere's a gift tag attached to the box, telling you that this present came from " . $session['user']['name'] . "`0.";
set_item_pref("description", $desc, $boxid);
}
//notify player that they've got something awesome waiting for them
require_once "lib/systemmail.php";
$body = "Someone has used the Gifting Station in Common Ground to send you something. Whatever it is, it'll turn up on your next new Game Day.";
systemmail($player, "Someone sent you something awesome!", $body);
if (!$free) {
$session['user']['donationspent'] += 1;
//log purchase
$sql = "INSERT INTO " . db_prefix("purchaselog") . " (acctid,purchased,amount,data,giftwrap,timestamp) VALUES ('" . $session['user']['acctid'] . "','giftstation_giftwrap','1','none','0','" . date("Y-m-d H:i:s") . "')";
$points = $session['user']['donation'] - $session['user']['donationspent'];
}
addnav("No, I think that'll do, thanks.", "gardens.php");
} else {
if (httpget("subop") == "searchagain") {
output("The KittyMorph nods, scratching out the contestant's name on his clipboard. \"`1No problem. Let's take it from the top.`0\"`n`n");
addnav("Actually, forget the whole thing.", "gardens.php");
} else {
output("`0You head into the Gift Exchange. A black-furred KittyMorph stands behind a counter.`n`n\"`1Hey there!`0\" he says. \"`1As part of our continued diplomatic efforts, we provide a gift-wrapping service for items you'd like to send to your fellow contestants. Interested?`0\"`n`n");
output("It costs one Supporter Point to gift-wrap and transfer (nearly) any item to any player. Some items can be transferred for free. You currently have %s Supporter Points.`n`n", number_format($points));
addnav("No thanks.", "gardens.php");
}
}
if ($points > 0) {
output("Search below for a player to send a present to.");
rawoutput("<form action='runmodule.php?module=giftstation&op=findplayer' method='post'>");
rawoutput("<input name='name'>");
rawoutput("<input type='submit' class='button' value='" . translate_inline("search") . "'>");
rawoutput("</form>");
addnav("", "runmodule.php?module=giftstation&op=findplayer");
} else {
output("You don't have any Supporter Points!`n`n");
}
break;
case "findplayer":
$search = "%";
$n = httppost('name');
for ($x = 0; $x < strlen($n); $x++) {
$search .= substr($n, $x, 1) . "%";
}
$search = " AND name LIKE '" . addslashes($search) . "' ";
$uid = $session['user']['uniqueid'];
$lastip = $session['user']['lastip'];
$sql = "SELECT uniqueid, acctid, name FROM " . db_prefix("accounts") . " WHERE locked=0 {$search} ORDER BY name DESC ";
$result = db_query($sql);
output("The KittyMorph nods. \"`1Okay, let's have a look at who I've got written down here whose name sounds like that...`0\"`n`n");
$matches = 0;
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($row['uniqueid'] != $session['user']['uniqueid']) {
addnav("", "runmodule.php?module=giftstation&op=chooseitem&player=" . $row['acctid']);
output_notl("<a href='runmodule.php?module=giftstation&op=chooseitem&player=" . $row['acctid'] . "'>" . $row['name'] . "</a>", true);
output("`n");
$matches++;
}
}
if ($matches == 0) {
output("He looks down at his list. \"`1Oh. Actually, it doesn't look like there's `ianyone`i matching that description who you can send a present to. Bummer. Wanna try that again?`0\"");
}
addnav("Return to Common Ground", "gardens.php");
addnav("Search Again", "runmodule.php?module=giftstation&op=start");
break;
case "chooseitem":
$player = httpget('player');
output("The KittyMorph reaches below his counter and brings up a clipboard on which he writes down the name of your nominated contestant. \"`1Okay, I've got the name - now, what would you like to send?`0\"`n`n");
$giftables = get_items_with_prefs("giftable");
if ($giftables) {
$giftables = group_items($giftables);
foreach ($giftables as $sortid => $prefs) {
$itemid = $prefs['itemid'];
if ($prefs['freegift']) {
addnav("Send for free");
addnav(array("%s (%s available)", $prefs['verbosename'], $prefs['quantity']), "runmodule.php?module=giftstation&op=choosewrapping&item={$itemid}&player={$player}&free=1");
} else {
addnav("Send for one Supporter Point");
addnav(array("%s (%s available)", $prefs['verbosename'], $prefs['quantity']), "runmodule.php?module=giftstation&op=choosewrapping&item={$itemid}&player={$player}&free=0");
}
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:giftstation.php
示例12: rail_collector_dohook
function rail_collector_dohook($hookname, $args)
{
global $session;
switch ($hookname) {
case "newday":
set_module_pref("cardstoday", 0);
$wherefound = array();
set_module_pref("wherefound", serialize($wherefound));
// calculate cardluck:
// (we do it this way to have better control over the shape of the curve - bell is too generous)
$c0 = get_module_setting("cardluckchance0");
$c2 = get_module_setting("cardluckchance2");
$c3 = get_module_setting("cardluckchance3");
$c4 = get_module_setting("cardluckchance4");
// a little paranoia never hurt anyone
$c1 = 100 - $c0 - $c2 - $c3 - $c4;
if ($c1 <= 0) {
// the module settings are fubar'd. Go with the defaults
$c0 = 5;
$c1 = 60;
$c2 = 25;
$c3 = 5;
}
$t0 = $c0;
$t1 = $t0 + $c1;
$t2 = $t1 + $c2;
$t3 = $t2 + $c3;
$d100 = e_rand(1, 100);
switch ($d100) {
case $d100 <= $t0:
$luck = 0;
break;
case $d100 <= $t1:
$luck = 1;
break;
case $d100 <= $t2:
$luck = 2;
break;
case $d100 <= $t3:
$luck = 3;
break;
default:
$luck = 4;
}
set_module_pref("cardluck", $luck);
if (rail_hascard("cardcase")) {
if ($luck == 0) {
output("`2Something seems out of kilter today, you're not sure what.`0`n");
}
if ($luck >= 3) {
output("`2You feel very lucky today! Wonderful things might happen to you.`0`n");
}
}
// award rail passes:
$val = rail_collector_valuehand();
if (!$val['firstclass'] && $val['value'] > 0) {
// no Joker, so give them however many regular rail passes they are entitled to:
for ($i = 0; $i < $val['value']; $i++) {
give_item("railpass");
}
// empty their hand (and if they had more than 5 cards, well... tough.)
$qty = rail_collector_emptyhand();
if ($val['value'] == 1) {
$phrase = "an `bImprobable Island Railway Company RAIL PASS`b";
} else {
$phrase = "not just one, but `b" . $val['value'] . " Improbable Island Railway Company RAIL PASSES`b";
}
output("`2Uh-oh, your card case feels much lighter. You had %s valuable cards here and they've all been bloody `istolen!`i Filthy midget bast-- wait, what? What's this? In their place, you now have %s! Awesome! ...um, so maybe it wasn't midgets after all. Critical mass, improbability, whatever. Who cares!`0`n", $qty, $phrase);
}
// end - awarding of rail passes
break;
// end case 'newday'
// end case 'newday'
case "iitems_tradables-top":
// remove any rail-feature tradables (ie, cards) if recipient has no card case.
if (has_item("cardcase", false, $args['tradewith']['acctid']) === false) {
$playerhascards = false;
if (is_array($args['tradables'])) {
foreach ($args['tradables'] as $tkey => $tdetails) {
if ($tdetails['feature'] == "rail") {
$playerhascards = true;
unset($args['tradables'][$tkey]);
}
}
}
if ($playerhascards) {
output("Unfortunately, %s has no place to put any cards.`n`n", $args['tradewith']['name']);
}
}
break;
// end case 'iitems_tradables-top'
// end case 'iitems_tradables-top'
case "improbablehousing_interior":
$hid = $args['hid'];
$rid = $args['rid'];
$locs = rail_collector_getlocs();
$collectspot = 0;
$key = "unknown";
$phrase = "in a shadowy corner of the room";
foreach ($locs as $loc => $locarray) {
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:rail_collector.php
示例13: iitems_hunterslodge_run
//.........这里部分代码省略.........
addnav("Back to the Grotto", "superuser.php");
break;
case "explain":
output("You give a friendly nod to the proprietor, and open your mouth to ask him a question.`n`nHe grins back at you.`n`nThere's a small `ipop`iping sensation in the centre of your skull, like a muscle abruptly shifting - and you suddenly realise what this place is all about.`n`n`bAbout Supporter Points`b`nImprobable Island is entirely funded by donations from its players. When you donate, you get Supporter Points, which you can use on items in the Hunter's Lodge. You get one hundred Supporter Points per US Dollar, and donations are accepted through PayPal. To donate, click the coin slot to the lower right of your screen. Always use the \"Site Admin\" PayPal button when donating if you wish to receive Supporter Points (donations made through the \"Author\" button go to Eric Stevens, the author of the game engine on which Improbable Island was originally based - you don't get any Supporter Points for donating through this button). You can also get Supporter Points by referring new players to the site (click the Referrals link to the left) or sometimes in `4Other Ways`0 which will be announced from time to time.`n`n`bTo give presents`b`nAll Hunter's Lodge items (and most other in-game items) can be given as gifts to other players. Visit the Gifting Station in Common Ground to do so. Some items can be gifted for free - others cost one Supporter Point each to gift. Hunter's Lodge items that bestow permanent benefits (IE unlimited title change documents) can only be gifted if they're unused. In all cases, you'll get to choose your gift-wrap and whether to give anonymously or not.`n`n`bHey, it's my birthday soon. Can I ask my non-Island-playing mates to buy me points on the Island?`b`nYes! Just send them to this link:`nhttp://www.improbableisland.com/runmodule.php?module=giftpoints&acctid=%s`n`n", $session['user']['acctid']);
addnav("Okay");
addnav("Back to the Hunter's Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
addnav("Referrals", "runmodule.php?module=iitems_hunterslodge&op=referrals");
break;
case "referrals":
output("If you help bring new players to Improbable Island, you'll earn one Supporter Point every time those players hit a new Game Day. To refer players, use this address:`n`n");
$url = getsetting("serverurl", "http://" . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . $_SERVER['SERVER_PORT']) . dirname($_SERVER['REQUEST_URI']));
if (!preg_match("/\\/\$/", $url)) {
$url = $url . "/";
savesetting("serverurl", $url);
}
output_notl("%shome.php?r=%s`n`n", $url, rawurlencode($session['user']['login']));
$sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE referer={$session['user']['acctid']} ORDER BY dragonkills,level";
$result = db_query($sql);
$number = db_num_rows($result);
if ($number) {
output("Accounts you've referred:`n");
for ($i = 0; $i < $number; $i++) {
$row = db_fetch_assoc($result);
output_notl("%s`0`n", $row['name']);
}
}
addnav("Okay");
addnav("Back to the Hunter's Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
break;
case "start":
output("You head into the Hunter's Lodge. It's a bright, shiny place, with many expensive-looking items arranged inside glass cabinets. The proprietor, a snappily-dressed male Joker, grins at you from behind the counter.`n`n");
if (!has_item("lodgebag")) {
output("The joker silently hands you a small bag, with a look that suggests you put your purchases inside.`n`n");
give_item("lodgebag");
}
output("`0You have `b`5%s`0`b Supporter Points left, out of `5%s`0 accumulated in total.`n`n", number_format($pointsleft), number_format($pointstotal));
addnav("What's all this about, then?");
addnav("How do I get supporter points, or give presents to people?", "runmodule.php?module=iitems_hunterslodge&op=explain");
$lodgeitems = get_items_with_settings("lodge");
//debug($lodgeitems);
rawoutput("<table width=100% style='border: dotted 1px #000000;'>");
$boughtitems = array();
$sql = "SELECT * FROM " . db_prefix("purchaselog") . " WHERE acctid = '" . $session['user']['acctid'] . "'";
$result = db_query($sql);
while ($row = db_fetch_assoc($result)) {
$boughtitems[$row['purchased']] = 1;
}
foreach ($lodgeitems as $key => $vals) {
if (!$vals['lodge']) {
continue;
}
$classcount += 1;
$class = $classcount % 2 ? "trdark" : "trlight";
rawoutput("<tr class='{$class}'><td>");
if ($vals['image']) {
rawoutput("<table width=100% cellpadding=0 cellspacing=0><tr><td width=100px align=center><img src=\"images/items/" . $vals['image'] . "\"></td><td>");
}
output("`b%s`b`n", stripslashes($vals['verbosename']));
output("%s`0`n", stripslashes($vals['description']));
if ($vals['weight']) {
output("Weight: %s kg`n`0", $vals['weight']);
}
rawoutput("<table width=100%><tr><td width=50%>");
if ($vals['tradable']) {
output("`5Giftable Item`0`n");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:67,代码来源:iitems_hunterslodge.php
示例14: meatsystem_run
function meatsystem_run()
{
global $session;
require_once "modules/staminasystem/lib/lib.php";
page_header("Meat!");
addnav("Meat Skills");
$from = httpget('from');
switch (httpget('op')) {
case "devour":
//special ability for Zombies only - Zombies can eat raw meat, so we're giving them the ability to simply devour the carcass where it lies.
$carcasses = unserialize(get_module_pref("carcasses"));
if (!is_array($carcasses)) {
$carcasses = array();
}
debug($carcasses);
foreach ($carcasses as $carcassnum => $creatureid) {
$sql = "SELECT creaturename FROM " . db_prefix("creatures") . " WHERE creatureid = " . $creatureid . " ";
$result = db_query_cached($sql, "creaturename-" . $creatureid, 86400);
$creature = db_fetch_assoc($result);
output("Giving in to your primal urges, you lean down and begin ripping meat from the still-twitching %s with your teeth.`n`n", $creature['creaturename']);
$meat1 = get_module_objpref("creatures", $creatureid, "meat1");
$meat2 = get_module_objpref("creatures", $creatureid, "meat2");
$meat3 = get_module_objpref("creatures", $creatureid, "meat3");
for ($i = 0; $i < $meat1; $i++) {
increment_module_pref("nutrition", 1, "staminafood");
increment_module_pref("fat", 3, "staminafood");
increment_module_pref("fullness", 1, "staminafood");
addstamina(1000);
}
for ($i = 0; $i < $meat2; $i++) {
increment_module_pref("nutrition", 2, "staminafood");
increment_module_pref("fat", 2, "staminafood");
increment_module_pref("fullness", 1, "staminafood");
addstamina(2000);
}
for ($i = 0; $i < $meat3; $i++) {
increment_module_pref("nutrition", 3, "staminafood");
increment_module_pref("fat", 1, "staminafood");
increment_module_pref("fullness", 1, "staminafood");
addstamina(5000);
}
output("For the record, and since it's nice to know these things even if you're too busy tearing cartilage and muscle from the bone to really pay attention to them, in this meal you have eaten %s bite's-worth of Crap Meat, %s bite's-worth of Half-Decent Meat, and %s bite's-worth of Tasty Meat.`n", $meat1, $meat2, $meat3);
$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");
}
unset($carcasses[$carcassnum]);
set_module_pref("carcasses", serialize($carcasses));
}
break;
case "clean":
$creatureid = httpget('creatureid');
$carcass = httpget('carcass');
$meat1 = get_module_objpref("creatures", $creatureid, "meat1");
$meat2 = get_module_objpref("creatures", $creatureid, "meat2");
$meat3 = get_module_objpref("creatures", $creatureid, "meat3");
$amber = get_stamina();
$return = process_action("Cleaning the Carcass");
if ($return['lvlinfo']['levelledup'] == true) {
output("`n`c`b`0You gained a level in Cleaning Carcasses! You are now level %s! This action will cost fewer Stamina points now, so you can butcher more creatures each day!`b`c`n", $return['lvlinfo']['newlvl']);
}
$failchance = e_rand(0, 100);
if ($failchance > $amber) {
//failure - the nice meat gets turned into Crap Meat
$meat1 += $meat2;
$meat1 += $meat3;
output("`4You sit down to clean the carcass. Your exhausted, clumsy incisions make a mockery of the choicest cuts - what is left over can only be described as Crap Meat. %s bite's-worth, to be precise. It looks like it was hacked into chunks by a blind woodsman.", $meat1);
//todo
for ($i = 0; $i < $meat1; $i++) {
give_item("meat_low", false, false, true);
}
load_inventory();
$carcasses = unserialize(get_module_pref("carcasses"));
unset($carcasses[$carcass]);
$carcasses = array_values($carcasses);
set_module_pref("carcasses", serialize($carcasses));
} else {
//success - all meat is sorted
output("You spend a few minutes up to your elbows in gore, and getting rather hungry.`n");
if ($meat1 > 0) {
output("You tear off enough to make %s rough bite's-worth of what the locals affectionately call Crap Meat. It's mostly wobbling chunks of stinking yellow fat, intermingled with the occasional squirmy tendon.`n", $meat1);
}
if ($meat2 > 0) {
output("You make swift work of the fattier muscle, and before too long you have %s rough bite's-worth of Half-Decent Meat.`n", $meat2);
}
if ($meat3 > 0) {
output("The red, tender slivers of muscle slide easily from the bone, and you wind up with %s rough bite's-worth of Tasty Meat.`n", $meat3);
}
//todo
for ($i = 0; $i < $meat1; $i++) {
give_item("meat_low", false, false, true);
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:meatsystem.php
示例15: rail_ironhorse_run
//.........这里部分代码省略.........
$session['user']['location'] = "House: " . $tohousename . ", Room " . $torid . "";
output("`0The `@Conductor `0smiles toothily as you prepare to disembark. \"`2Thank-you for travelling with the `bImprobable Island Railway Company`b. Please don't forget to take all your luggage with you, and have an improbable day!`0\"`n`n");
output("`2%s`0`n`n", $locs[$loc][4]);
addnav("Get off the train");
addnav(array("`2%s`0 Platform", $locs[$loc][2]), "runmodule.php?module=improbablehousing&op=interior&hid={$tohid}&rid={$torid}");
if (!($loc == "WA") && !($loc == "DB")) {
addnav("Wait, I've changed my mind");
addnav("`2Stay `0 on board", "runmodule.php?module=rail_ironhorse&op=board&hid={$tohid}&rid={$torid}");
} else {
output("`2You feel stronger after your pleasant train ride, and rather refreshed!`n`n`0");
if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) {
$session['user']['hitpoints'] = $session['user']['maxhitpoints'];
} else {
$session['user']['hitpoints'] = $session['user']['hitpoints'] * 1.1;
require_once "modules/staminasystem/lib/lib.php";
addstamina(25000);
}
}
page_footer();
break;
case "request":
page_header("First Class has its privileges!");
output("`2As holder of an Improbable Island Railway Company `bFirst Class`b Rail Pass, you have the privilege of asking the train to let you off anywhere on the map. Yes, even in the deepest ocean, should that be your whim! This is, after all, an `iImprobable`i railway system; it can accomplish the seemingly impossible.`n`nSimply tell the `@Conductor `2where on the Island you would like to be dropped off.`0`n`n");
rawoutput("<form action='runmodule.php?module=rail_ironhorse&op=requestfinish&hid=" . $fromhid . "&rid=" . $fromrid . "' method='POST'>");
// Note: Width 2 means a 2-digit number. Set the default location to 13,11 Improbable Central.
rawoutput("X = <input name='stopX' width='2' value='13'> , Y = <input name='stopY' width='2' value='11'><br/><br/>");
rawoutput("<input type='submit' class='button' value='" . translate_inline("Stop here!") . "'>");
rawoutput("</form>");
addnav("", "runmodule.php?module=rail_ironhorse&op=requestfinish&hid={$fromhid}&rid={$fromrid}");
addnav("Wait, I've changed my mind");
addnav("`2Stay `0 on board", "runmodule.php?module=rail_ironhorse&op=board&hid={$fromhid}&rid={$fromrid}");
page_footer();
break;
case "requestfinish":
page_header("First Class has its privileges!");
$x = httppost("stopX");
$y = httppost("stopY");
// strip out any non-numeric characters that got entered by mistake
$x = ereg_replace("[^0-9]", "", $x);
$y = ereg_replace("[^0-9]", "", $y);
// make sure they entered values that are in range for the size of the map.
$sizeX = get_module_setting("worldmapsizeX", "worldmapen");
$sizeY = get_module_setting("worldmapsizeY", "worldmapen");
if ($x <= 0 || $x > $sizeX || $y <= 0 || $y > $sizeY) {
output("`2Sorry mate, stay on the map. Train service doesn't run outside the Improbability bubble. Nice try though.`0");
addnav("Oops!");
addnav("Let's try that again", "runmodule.php?module=rail_ironhorse&op=request&hid={$fromhid}&rid={$fromrid}");
} else {
output("`0The `@Conductor `0smiles, all sleek and fangsome, as you prepare to disembark. \"`2Thank-you for travelling with the `bImprobable Island Railway Company`b. Please don't forget to take all your luggage with you, and have an improbable day!`0\"`n`n");
rail_ironhorse_cleanup($fromhid);
$maploc = $x . "," . $y . ",1";
set_module_pref("worldXYZ", $maploc, "worldmapen");
addnav("Thanks!");
addnav("`2Leave `0 the train", "runmodule.php?module=worldmapen&op=continue");
}
page_footer();
break;
case "choose":
$pass = httpget("pass");
if ($pass == "first") {
rail_ironhorse_activatepass("railpassfirst");
} else {
rail_ironhorse_activatepass("railpass");
}
addnav("", "runmodule.php?module=rail_ironhorse&op=board&hid={$fromhid}&rid={$fromrid}");
redirect("runmodule.php?module=rail_ironhorse&op=board&hid={$fromhid}&rid={$fromrid}");
break;
case "stationmaster":
page_header("The Stationmaster");
$val = rail_collector_valuehand();
// note, we only get here if there's a joker in the hand, so only first class passes
if ($val['value'] > 2) {
$phrase = "that's quite a hand you have there. Quite a hand! I think in this case we could even stretch to `b" . $val['value'] . "`b First Class Rail Passes.";
} else {
if ($val['value'] > 1) {
$phrase = "excellent. For that hand, we could easily give you `btwo`b First Class Rail Passes.";
} else {
$phrase = "no question about it, definitely a `bFirst Class Rail Pass`b.";
}
}
output("`2Having heard that this eccentric railroad company will sometimes give out a rail pass in exchange for used playing cards, you show the Stationmaster your grubby little collection. \"`#Interested?`2\" you ask.`n`n\"`^Why yes. Those would be worth... let me see. Oh, %s`2\"`0`n`n", $phrase);
addnav("What do you say?");
addnav("It's a deal!", "runmodule.php?module=rail_ironhorse&op=stationmasterdeal&hid={$fromhid}&rid={$fromrid}");
addnav("No thanks, I'll wait", "runmodule.php?module=improbablehousing&op=interior&hid={$fromhid}&rid={$fromrid}");
page_footer();
break;
case "stationmasterdeal":
page_header("The Stationmaster");
$val = rail_collector_valuehand();
for ($i = 0; $i < $val['value']; $i++) {
give_item("railpassfirst");
}
$qty = rail_collector_emptyhand();
output("`2The Stationmaster thanks you, and the two of you make the exchange to your mutual satisfaction. What on earth the Company `iwants`i with all those old playing cards... well. You've naturally wondered about that from time to time, but they're not saying.`0`n`n");
addnav("Leave");
addnav("Return to the platform", "runmodule.php?module=improbablehousing&op=interior&hid={$fromhid}&rid={$fromrid}");
page_footer();
break;
}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:rail_ironhorse.php