本文整理汇总了PHP中villagenav函数的典型用法代码示例。如果您正苦于以下问题:PHP villagenav函数的具体用法?PHP villagenav怎么用?PHP villagenav使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了villagenav函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: monsterkills_run
function monsterkills_run()
{
page_header("Most Monster Kills");
$acc = db_prefix("accounts");
$mp = db_prefix("module_userprefs");
$sql = "SELECT {$acc}.name AS name,\r\n\t\t{$acc}.acctid AS acctid,\r\n\t\t{$mp}.value AS kills,\r\n\t\t{$mp}.userid FROM {$mp} INNER JOIN {$acc}\r\n\t\tON {$acc}.acctid = {$mp}.userid \r\n\t\tWHERE {$mp}.modulename = 'monsterkills' \r\n\t\tAND {$mp}.setting = 'kills' \r\n\t\tAND {$mp}.value > 0 ORDER BY ({$mp}.value+0)\t\r\n\t\tDESC limit " . get_module_setting("list") . "";
$result = db_query($sql);
$rank = translate_inline("Kills");
$name = translate_inline("Name");
output("`n`b`c`@Most`\$ Monster `@Kills`n`n`c`b");
rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center'>");
rawoutput("<tr class='trhead'><td align=center>{$name}</td><td align=center>{$rank}</td></tr>");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($row['name'] == $session['user']['name']) {
rawoutput("<tr class='trhilight'><td>");
} else {
rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td align=left>");
}
output_notl("%s", $row['name']);
rawoutput("</td><td align=right>");
output_notl("%s", $row['kills']);
rawoutput("</td></tr>");
}
rawoutput("</table>");
addnav("Back to HoF", "hof.php");
villagenav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:29,代码来源:monsterkills.php
示例2: dwellings_run
function dwellings_run()
{
checkday();
page_header("Dwellings");
global $session;
$op = httpget("op");
$dwid = httpget('dwid');
$type = httpget('type');
debug(get_module_pref("location_saver"));
if ($type == "" && $dwid > 0) {
$sql = "SELECT type FROM " . db_prefix("dwellings") . " WHERE dwid={$dwid}";
$result = db_query($sql);
$row = db_fetch_assoc($result);
$type = $row['type'];
}
$cityid = httpget('cityid');
require_once "modules/dwellings/run/case_{$op}.php";
if ($op != "list" && $op != "") {
addnav("Leave");
addnav("Return to Hamlet", "runmodule.php?module=dwellings");
} else {
addnav("Navigation");
villagenav();
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:26,代码来源:dwellings.php
示例3: forest
function forest($noshowmessage = false)
{
global $session, $playermount;
tlschema("forest");
// mass_module_prepare(array("forest", "validforestloc"));
addnav("Heal");
addnav("H?Hospital Tent", "healer.php");
addnav("Fight");
addnav("L?Look for Something to Kill", "forest.php?op=search");
if ($session['user']['level'] > 1) {
addnav("S?Go Slumming", "forest.php?op=search&type=slum");
}
addnav("T?Go Thrillseeking", "forest.php?op=search&type=thrill");
if (getsetting("suicide", 0)) {
if (getsetting("suicidedk", 10) <= $session['user']['dragonkills']) {
addnav("*?Search `\$Suicidally`0", "forest.php?op=search&type=suicide");
}
}
if ($session['user']['level'] >= 15 && $session['user']['seendragon'] == 0) {
// Only put the green dragon link if we are a location which
// should have a forest. Don't even ask how we got into a forest()
// call if we shouldn't have one. There is at least one way via
// a superuser link, but it shouldn't happen otherwise.. We just
// want to make sure however.
$isforest = 0;
$vloc = modulehook('validforestloc', array());
foreach ($vloc as $i => $l) {
if ($session['user']['location'] == $i) {
$isforest = 1;
break;
}
}
if ($isforest || count($vloc) == 0) {
addnav("G?`@Seek Out the Green Dragon", "forest.php?op=dragon");
}
}
addnav("Other");
villagenav();
if ($noshowmessage != true) {
output("`c`7`bThe Forest`b`0`c");
output("The Forest, home to evil creatures and evildoers of all sorts.`n`n");
output("The thick foliage of the forest restricts your view to only a few yards in most places.");
output("The paths would be imperceptible except for your trained eye.");
output("You move as silently as a soft breeze across the thick moss covering the ground, wary to avoid stepping on a twig or any of the numerous pieces of bleached bone that populate the forest floor, lest you betray your presence to one of the vile beasts that wander the forest.`n");
modulehook("forest-desc");
}
modulehook("forest", array());
module_display_events("forest", "forest.php");
addnav("Inventory");
addnav("View your Inventory", "inventory.php?items_context=forest");
tlschema();
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:52,代码来源:forest.php
示例4: strategyhut_run
function strategyhut_run()
{
global $session;
$cost = get_module_setting("cost");
$op = httpget("op");
page_header("The Strategy Hut");
output("`5`c`bThe Strategy Hut`b`c");
if ($op == "") {
addnav(array("Ask for Advice (`^%s gold`0)", $cost), "runmodule.php?module=strategyhut&op=ask");
output("`&You enter the hut, to find `6Atrus `&busy at his desk.");
output("\"`^Well, a young warrior in search of help!");
output("For a small fee, I will offer advice to you.`3\"`n`n");
output("`&Hesitantly, you approach the burly warrior.`n`n");
output("`&You blink a few times before you realize he was actually talking to you.");
output("`6Atrus `&doesn't seem very patient, so you'd better decide quickly if you want to hear his advice!`n");
} elseif ($session['user']['gold'] < $cost) {
output("`&You go through your pockets, searching for money, but you don't have enough.");
output("After a moment of intense searching, `6Atrus `&starts to scowl, and you decide to leave before he gets annoyed.`n`n");
} else {
$session['user']['gold'] -= $cost;
debuglog("spent {$cost} gold at the strategy hut");
output("`&You give `6Atrus `^%s gold`7.", $cost);
output("`&He nods, and thinks for a moment.`n`n");
$phrases = array("\"`^Heal often, bank often.`3\"", "\"`^Think balance: weapons and armor must be close in level, not enough defense and your first attack will be your last.`3\"", "\"`^Don't be afraid to slum, in the lower DK levels, speed is NOT a priority. Later is different.`3\"", "\"`^That stat bar is your life, when it gets into the yellow zone, heal. When it goes red, pray.`3\"", "\"`^In PvP, pick your targets with care. If not sure, DON'T... or you'll be explaining to {deathoverlord}`^ what happened.`3\"", "\"`^You don't always need to resurrect. There will be times to save favor for emergencies.`3\"", "\"`^If it's a game bug, petition it. If it's a gameplay issue, petition it.`3\"", "\"`^A good offense is not always a good defense, even the strongest players die in the forest.`3\"", "\"`^Confidence is one thing: attacking a God is suicide. Check the bio first.`3\"", "\"`^Keep an open mind and think it through. Only a fool fights blindly.`3\"", "\"`^There is a dragon, and when you are ready, it will be too. Patience.`3\"", "\"`^Travelling between towns can be dangerous. Heal first.`3\"", "\"`^Talk to everyone in all the villages, visit the shops and stalls. Explore. Learn.`3\"", "\"`^Lower DK players die often in the beginning. It happens to all of us.`3\"", "\"`^When you face the dragon, be ready and fully healed... or it will eat you for lunch.`3\"", "\"`^Your mount or familiar is an asset... learn what it can do, and know its limits. *And* yours, as well.`3\"", "\"`^There is no shame in knowing when to run. Better a bruised ego than a visit to {deathoverlord}`^.`3\"", "\"`^Log in ONCE per game day only, or you will be killed repeatedly... and lose experience as a result. There is no safe place.`3\"", "\"`^If you can't resurrect, log off and wait for New Day. You are already dead.`3\"", "\"`^A good player treats his fellows with courtesy and respect. A wise player knows that new friends can help him succeed.`3\"", "\"`^Don't forget to feed your mount or familiar.`3\"");
$question = e_rand(0, count($phrases) - 1);
$phrases = translate_inline($phrases);
$myphrase = $phrases[$question];
$myphrase = str_replace('{deathoverlord}', getsetting('deathoverlord', '`$Ramius'), $myphrase);
output_notl("%s`n`n", $myphrase);
output("`&You ponder his advice for a moment, before thanking him and making your exit.`n`n");
if (is_module_active("medals")) {
require_once "modules/medals.php";
medals_award_medal("strategyhut", "Strategy Seeker", "This player asked for help in the Strategy Hut.", "medal_strategy.png");
}
}
villagenav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:38,代码来源:strategyhut.php
示例5: kissingbooth_run
function kissingbooth_run()
{
global $session;
require_once "lib/villagenav.php";
$gardens = get_module_setting("gardens");
$smackloss = get_module_setting("smackloss");
$cost = get_module_setting("cost");
$totalcost = $cost * $session['user']['level'];
page_header("The Kissing Booth");
$op = httpget('op');
$kissedtoday = get_module_pref("kissedtoday");
$kissee = get_module_pref("kissee");
output("`c`b`QThe `\$Kissing`Q Booth`0`b`c`n");
if ($op == "") {
while ($kissee == "") {
$guys = array(getsetting("barkeep", '`tCedrik'), "`!Lonestrider", "`@JR`3Min`!ga", "`6Smiythe", getsetting("bard", "`^Seth"), "`&Oliver", "`#MightyE", "`%Kendaer");
$girls = array("`)Heidi", "`7Petra", "`QSaucy`\$Wench", "`@Foil`&wench", getsetting('barmaid', "`%Violet"), "`^Ella");
if ($session['user']['sex'] != SEX_MALE) {
$kissee = $guys[e_rand(0, count($guys) - 1)];
} else {
$kissee = $girls[e_rand(0, count($girls) - 1)];
}
set_module_pref("kissee", $kissee);
}
// will change this if it's in a town (which town? romar? glorfy?
// d'burg? rather than a special area (carnival, esoterron (ew!))
output("`QYou walk towards the booth marked \"`@LOGD Kissing Booth`Q\".`n");
output("`QThere seems to be a decent line, possibly because %s`Q is behind the booth today!`n", $kissee);
if (!$kissedtoday) {
output("`QYou find yourself shuffled into the line, which seems to suddenly be moving fairly quickly.`n");
output("`QFinally, you reach the front!");
output("`QYour eyes dart to the jar marked \"`@Donations`Q\", and then meet the gaze of %s`Q, who looks up at you expectantly.`n", $kissee);
if ($totalcost > $session['user']['gold']) {
output("`!You can't afford the donation at the moment.");
output("%s`! smiles at you sadly as you slink off, dejected.", $kissee);
if ($gardens) {
addnav("G?Return to the Gardens", "gardens.php");
} else {
villagenav();
}
} else {
output("`QWhat will you do?");
addnav(array("Make donation (%s gold)", $totalcost), "runmodule.php?module=kissingbooth&op=stay");
addnav("Chicken out", "runmodule.php?module=kissingbooth&op=flee");
}
} else {
output("`Q`nYou know, that line seems really long, and you've already taken your turn today.`n");
output("`QMaybe you should wait until later, and let somebody else have their fun.");
if ($gardens) {
addnav("G?Return to the Gardens", "gardens.php");
} else {
villagenav();
}
}
} elseif ($op == "flee") {
output("`#You freeze with embarrasment at the thought of kissing %s`#.`n", $kissee);
output("`#After about a minute has passed and you're still standing there stammering, %s`# sighs and beckons the person behind you to come forward and take your place.`n", $kissee);
output("`#A helper gently takes you aside and seats you under a nearby tree to recover.");
if ($gardens) {
addnav("Leave", "gardens.php");
} else {
addnav("Leave", "village.php");
}
} elseif ($op == "stay") {
set_module_pref("kissedtoday", 1);
$session['user']['gold'] -= $totalcost;
if ($session['user']['sex'] != SEX_MALE) {
$heshe = "he";
$Cheshe = "He";
// "capital he/she." capital idea, wot?
$hisher = "his";
} else {
$heshe = "she";
$Cheshe = "She";
$hisher = "her";
}
$rnd = e_rand(1, 16);
switch ($rnd) {
case 1:
case 2:
case 3:
case 4:
case 5:
//charm++ (1-5)
output("`6You drop the coins in the jar.`n");
output("%s`6 leans forward and kisses you gently on the lips.", $kissee);
output("{$Cheshe} holds it slightly longer than you expected and pulls back with an impressed look on {$hisher} face.`n");
output("\"`#Not bad`6\", {$heshe} says, \"come back anytime!\"`n");
output("You blush slightly, but find a new confidence in your step as you walk away.`n");
output("You feel `\$charming`6!");
$session['user']['charm']++;
break;
case 6:
case 7:
case 8:
case 9:
//hp++ (6-9) (tee hee)
output("`6Stepping forward, you deposit your coins in the jar.`n");
output("%s`6 leans forward and kisses you softly but warmly.`n", $kissee);
output("`6The warmth floods your body, and eases your pain.`n");
//.........这里部分代码省略.........
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:kissingbooth.php
示例6: ella_run
function ella_run()
{
global $session;
$op = httpget("op");
require_once "lib/partner.php";
$partner = get_partner();
$candance = get_module_pref("candance");
$dkhp = 0;
while (list($key, $val) = each($session['user']['dragonpoints'])) {
if ($val == "hp") {
$dkhp++;
}
}
$maxhitpoints = 10 * $session['user']['level'] + $dkhp * 5;
suspend_temp_stats();
if ($session['user']['maxhitpoints'] < $maxhitpoints + get_module_setting("hitpointcost")) {
$notenough = true;
} else {
$notenough = false;
}
restore_temp_stats();
page_header("Dance Studio");
output("`&`c`bLady Ella's Dance Studio`b`c");
if (!$candance) {
output("`7Your muscles are still too stiff and sore from your last lesson.`n");
output("`7Perhaps in a day or so, you'll feel up to another lesson.");
} elseif ($notenough) {
output("`7You don't feel like you could take a lesson with Ella today.`n");
output("`7Perhaps if your constitution has risen a bit.");
} elseif ($op == "") {
output("`7A statuesque teacher in intricately-beaded garb stands at one end of a small studio, intently watching the movements of the dancers in the room.");
output("Partnered and solo dancers sway and spin in fast rhythms, matching their movements to the piano that sings from one side of the room, where a delicate Felyne moves her paws to create the sound.`n`n");
output("Noting your interest, Lady Ella smiles at you as she walks towards you.`n`n");
output("\"`&Lovely movement, everyone, keep going, I'll have you all as polished performers yet!`7\"`n`n");
output("`7She approaches you and beckons you into her office.");
$cost = get_module_setting("turncost");
if ($session['user']['turns'] >= $cost) {
output("Once there, she explains what she can offer.");
output("\"`&You'll like our lessons very much.");
output("We pride ourselves in making sure it's fun AND helpful.");
output("Who knows, you might land the %s of your dreams!`n`n", translate_inline($session['user']['sex'] ? "man" : "girl"));
output("Now, it takes a lot of time and effort to learn to dance, so you can't expect to have nearly as much time for galivanting around the forest.");
if ($session['user']['sex']) {
output("So, are you sure you want to make that commitment and learn to make the men chase you?`7\"");
} else {
output("So, are you sure you want to make that commitment and learn to sweep the ladies off their feet?`7\"");
}
output("`qYou realize she's asking for a sacrifice of time you would normally spend hunting in the forest.");
output("`qYou ponder for a moment on whether you want to make that large a commitment.");
addnav(array("Take Lesson (%s %s)", $cost, translate_inline($cost == 1 ? "turn" : "turns")), "runmodule.php?module=ella&op=dance");
} else {
output("Once there, she regards you gravely.");
output("\"`&Darling, there's nothing I love more than teaching someone the love of the dance.");
output("I'd be more than happy to let you watch, but by the looks of how tired out you are, you'd fall over from the exertion of actually dancing with us today.`7\"`n`n");
output("You nod your understanding, that you perhaps need more free time to get the most out of the strenuous training she has to offer.");
}
} else {
output("`7You agree to take a dancing lesson today, and eagerly move forward to join the other dancers.`n`n");
output("The music begins slowly, giving you the chance to start gradually, but it quickly becomes difficult and tiring.");
output("You're not sure how impressed %s`7 would be with your efforts, but you're determined not to give up too easily.`n`n", $partner);
output("After the lesson concludes, you feel weary, and wonder whether you have the strength to keep this up for many weeks to come.");
output("You sure hope %s`7 appreciates your efforts today.`n`n", $partner);
output("You feel `5charming!`n");
$turncost = (int) get_module_setting("turncost");
$hitpointcost = (int) get_module_setting("hitpointcost");
if ($turncost > 0 && $hitpointcost > 0) {
output("Your efforts had their price.");
output("You feel a little tired and not that enduring anymore.");
} else {
if ($turncost > 0) {
output("Your efforts had their price.");
output("You feel a little tired.");
} else {
if ($hitpointcost > 0) {
output("Your efforts had their price.");
output("You feel not that enduring anymore.");
}
}
}
debuglog("lost {$turncost} turns and {$hitpointcost} maxhitpoints for taking a dancing lesson.");
$session['user']['turns'] -= $turncost;
$session['user']['maxhitpoints'] -= $hitpointcost;
if ($session['user']['maxhitpoints'] < $session['user']['level'] * 10) {
$session['user']['maxhitpoints'] = $session['user']['level'] * 10;
}
$session['user']['charm'] += get_module_setting("charmgain");
set_module_pref("candance", 0);
$danceday = get_module_setting("danceday");
set_module_pref("dayswait", $danceday);
}
villagenav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:93,代码来源:ella.php
示例7: villhut_run
function villhut_run()
{
global $session;
$op = httpget('op');
$eattoday = get_module_pref("eattoday");
$turn = e_rand(1, 8);
page_header("Villager's Hut");
output("`&`c`bThe Villager's Hut`b`c");
if ($eattoday >= 3) {
output("`7`nYou walk towards the hut again, but your stomach can't bear the thought of more of those sweets today!`n`n");
$turn = 2;
} elseif ($op == "") {
$turn = 2;
output("`7You walk towards the well-lit front porch of the house, wondering at the lovely colored lights in the windows.`n`n");
output("As you get to the door, there's a bowl filled with bags of sweets, and a note.`n`n");
output("`7\"`%Hello Children!`7\" it reads.`n`n");
output("`7\"`%Please help yourselves to a bag!`7\"`n`n");
output("You stand there for a moment, wondering what to do.");
output("The residents obviously aren't home.`n`n");
output("How many bags should you take?`n`n");
addnav("Eat 1", "runmodule.php?module=villhut&op=1");
addnav("Eat 2", "runmodule.php?module=villhut&op=2");
addnav("Eat 3", "runmodule.php?module=villhut&op=3");
addnav("Eat 4", "runmodule.php?module=villhut&op=4");
} elseif ($op == "3") {
output("`7A shout emerges from the shadows nearby.`n`n");
output("\"`%You greedy pig!`7\" it screams.`n`n");
output("The next thing you realize, you're sopping wet, and `QSaucy`\$Wench `7is standing there with an empty bucket in her hands.`n`n");
output("You feel miserable, and `4lose `7some hitpoints.`n`n");
$session['user']['hitpoints'] = $session['user']['hitpoints'] * 0.85;
if ($session['user']['hitpoints'] < 1) {
$session['user']['hitpoints'] = 1;
}
$eattoday += 3;
$turn = 2;
set_module_pref("eattoday", $eattoday);
} elseif ($op == "4") {
output("`7A shout emerges from the shadows nearby.`n`n");
output("\"`%You greedy pig!`7\" it screams.`n`n");
output("You flee in terror, jumping over some thorn bushes as you run, and your arms and legs are ripped painfully.`n`n");
output("You finally make it to the village square, only to trip onto your face in a most embarrassing manner.`n`n");
output("You flush in shame, and `4lose `7some hitpoints and some charm.`n`n");
$session['user']['hitpoints'] = $session['user']['hitpoints'] * 0.65;
if ($session['user']['hitpoints'] < 1) {
$session['user']['hitpoints'] = 1;
}
if ($session['user']['charm'] > 0) {
$session['user']['charm']--;
}
$eattoday += 4;
$turn = 2;
set_module_pref("eattoday", $eattoday);
} elseif ($op == "1") {
output("`7You help yourself to a bag and begin to eat as you walk away.`n`n");
output("You feel `@healthy!`n`n");
$session['user']['hitpoints'] = max($session['user']['hitpoints'] + 3, $session['user']['hitpoints'] * 1.02);
$eattoday += 1;
set_module_pref("eattoday", $eattoday);
if ($eattoday > 0 && $eattoday < 3) {
addnav("M?Return for More", "runmodule.php?module=villhut");
}
} elseif ($op == "2") {
output("`7You snatch two bags and greedily begin to eat as you walk away.`n`n");
output("You feel `@healthy!`n`n");
$session['user']['hitpoints'] = max($session['user']['hitpoints'] + 5, $session['user']['hitpoints'] * 1.03);
$eattoday += 2;
set_module_pref("eattoday", $eattoday);
if ($eattoday > 0 && $eattoday < 3) {
addnav("M?Return for More", "runmodule.php?module=villhut");
}
}
if ($turn == 1) {
output("`7Swallowing the last sweet, you realize there was something unusual mixed in with the mountain of sugar.`n`n");
output("You feel `@energized!`n`n");
$session['user']['turns'] += 2;
}
villagenav();
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:79,代码来源:villhut.php
示例8: oldchurch_run
function oldchurch_run()
{
global $session;
page_header("Old Church");
$op = httpget('op');
$bloodgift = get_module_pref("bloodgift");
if ($bloodgift == 1) {
output("`7As you approach the old church, you are beset with troubling flashes of what happened last time you were here.");
output("`n`nYou decide to come back another day.");
villagenav();
} elseif ($op == "") {
output("`7An ancient church stands alone, apart from the other buildings, centuries-old scorchmarks marring the once grand walls and curling round the belltower.");
output("`n`nA thin path winds its way up the hill between sinister-looking memorials covered in mist.");
output("While the church has obviously been abandoned for a long time, the windows flicker with light from the inside and shadows can be seen dancing on the tall broken shards of glass which fill the windows.");
addnav("Enter the Church", "runmodule.php?module=oldchurch&op=enter");
addnav("Return to the Village", "village.php");
} elseif ($op == "enter") {
output("`3You make your way up the hill and edge through the sundered doors, taking in the wrecked interior.");
output("A flickering torch inhabits an iron holder to one side, above a dusty font.");
output("Beyond the shattered pews lies an altar which has fresh cloths on it and six candles burning dimly.`n`n");
output("From out of a small door to one side of the altar walks a curiously hearty figure dressed in grey robes who, ignoring the desolate surroundings, opens his arms wide and bids you welcome to the church, \"`^Greetings, greetings, welcome to this little sanctuary. I am `5Capelthwaite`^, and it is good to see people once again visiting this holy place, feel free to look around. My apologies for the current... disarray... but the world is as the Gods decree it, and we must merely live with such things.`3\"");
output("He casts an appraising eye over you and smiles even more broadly before continuing,");
output("\"`^Naturally we are always in need of funds for various charitable projects, and if you wish to donate you will of course gain an appropriate reward.");
output("For those as hardy an adventurer as you there are obviously other ways to earn a blessing if you are short of funds.`3\"");
output("He smiles to himself and waits at the altar for your decision.");
addnav("Climb to the Belfry", "runmodule.php?module=oldchurch&op=belfry");
addnav("Examine the Font", "runmodule.php?module=oldchurch&op=font");
addnav("Donate Gold", "runmodule.php?module=oldchurch&op=donate");
addnav("Ask About \"Other Ways\"", "runmodule.php?module=oldchurch&op=ritual");
addnav("Leave this Place", "village.php");
} elseif ($op == "belfry") {
output("`7You walk to the back of the church and climb the unsteady steps up to the belfry, where a large rusted bell hangs from rotting timbers.");
output("Though you'd expect to get a great view from up here, even the nearby buildings seem shrouded in fog.");
$random = e_rand(1, 3);
if ($random >= 2) {
output("`n`nAs you hurry down from the belfry, you accidentally knock into the bell, which makes an eerily resonant sound as it tolls.");
}
output("Spooked slightly, you hurry down the stairs and back into the church.");
addnav("Examine the Font", "runmodule.php?module=oldchurch&op=font");
addnav("Donate Gold", "runmodule.php?module=oldchurch&op=donate");
addnav("Ask About \"Other Ways\"", "runmodule.php?module=oldchurch&op=ritual");
addnav("Leave this Place", "village.php");
} elseif ($op == "font") {
output("`\$As you wander over to the alcove by the door and look inside, there seem to be dark stains inside the font, as though it was not usually used for water.");
output("`n`n`^Slightly troubled by this, you return to the main part of the church.");
addnav("Climb to the Belfry", "runmodule.php?module=oldchurch&op=belfry");
addnav("Donate Gold", "runmodule.php?module=oldchurch&op=donate");
addnav("Ask About \"Other Ways\"", "runmodule.php?module=oldchurch&op=ritual");
addnav("Leave this Place", "village.php");
} elseif ($op == "donate") {
output("`5Capelthwaite `^grins as you walk over to the donation plate, waiting to see how much you will put in before making any preparations.");
$donate = array("donation" => "Donation,int");
require_once "lib/showform.php";
rawoutput("<form action='runmodule.php?module=oldchurch&op=afterdonate' method='POST'>");
showform($donate, array(), true);
addnav("", "runmodule.php?module=oldchurch&op=afterdonate");
$give = translate_inline("Give Money");
rawoutput("<input type='submit' class='button' value='{$give}'>");
rawoutput("</form><br>");
addnav("Change your mind", "runmodule.php?module=oldchurch&op=enter");
addnav("Leave this Place", "village.php");
} elseif ($op == "afterdonate") {
$donation = httppost('donation');
if ($donation > $session['user']['gold'] || $donation < 0) {
output("`5Capelthwaite `^looks somewhat grim as you try to persuade him that it is the spirit of giving which counts.`n`n");
output("You are hastily ejected from the church.");
} elseif ($donation >= $session['user']['level'] * 103) {
output("`^As you put a hefty amount of gold in the bowl, `5Capelthwaite`^'s grin widens and he beckons you over to the altar for a blessing.");
output("`n`nAfter muttering something a little too fast for you to catch, he places his hand on your head and blesses you.");
output("`n`n`@You feel energy flowing through you!");
$session['user']['gold'] -= $donation;
debuglog("donated {$donation} gold at the old church");
$donated = get_module_pref("donated");
apply_buff('capelthwaite_blessing', array("name" => "`5Capelthwaite's Blessing", "rounds" => 15, "wearoff" => "The burst of energy passes.", "atkmod" => $donated ? 1.05 : 1.2, "defmod" => $donated ? 1.01 : 1.1, "roundmsg" => "Energy flows through you!", "schema" => "module-oldchurch"));
output("Filled with energy you stumble out of the church.");
set_module_pref("donated", 1);
} else {
output("`^As the few coins you decided to spare rattle into the bowl, `5Capelthwaite`^'s grin turns sickening as he beckons you over to the altar.`n`n");
output("After muttering something too low for you to catch, he places his hand on your head and places the enchantment on you.`n`n");
output("`4Dark energy flows through you!");
apply_buff('capelthwaite_curse', array("name" => "`5Capelthwaite's \"Blessing\"", "rounds" => 10, "wearoff" => "The burst of energy passes.", "atkmod" => 0.8, "defmod" => 0.9, "roundmsg" => "Dark Energy flows through you!", "schema" => "module-oldchurch"));
output("Filled with energy you stumble out of the church.");
$session['user']['gold'] -= $donation;
debuglog("donated {$donation} gold at the old church");
set_module_pref("donated", 1);
}
villagenav();
} elseif ($op == "ritual") {
output("`3You nervously inquire about another way that you could earn a blessing as `5Capelthwaite`3 looks on you magnanimously.`n`n");
output("\"`^No need to be so nervous my friend, simply a short rite to honour the master, you'll feel fine the next day. Just take this potion and I'll take care of everything.`3\".`n`n");
output("He holds out a small black potion he produced from somewhere for you to drink and smiles encouragingly.");
addnav("Take the Potion", "runmodule.php?module=oldchurch&op=darkritual");
addnav("Leave this Place", "village.php");
} elseif ($op == "darkritual") {
output("`^Trusting in `5Capelthwaite`^'s friendly smile, you drink down the potion. You feel funny for a moment, then the world begins to swim before your eyes, and you black out.`n`n");
$ritual = e_rand(1, 100);
if ($ritual >= 100) {
output("`7Though the potion sapped all will from your body, you remain conscious as you are dragged somewhere, hooded, by several people.");
output("When the hood is removed you are in a cavern deep underground, trapped in what looks like some artist's rendition of the underworld.");
output("You are dressed in a grey robe and placed on the edge of a smoke-filled circle with many others similarly outfitted.");
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:oldchurch.php
示例9: proveyourself_run
//.........这里部分代码省略.........
addnav("You need to heal up first");
addnav("Back to the Outpost", "village.php");
}
}
}
}
break;
case "enter":
output("You drop your cigarette into an unnecessarily ornate box, and the Mutant ushers you through a wooden door and into the mouth of a long, dark, red-carpeted corridor.`n`n\"`4Drink this,`0\" he says, passing you a simple wooden goblet filled with a sticky-looking fluid. You sniff cautiously, then drink. It tastes of dust and steel.`n`n\"`4Now remember; nothing in here can hurt you unless you allow it to.`0\" His voice drops to a whisper as he presses a battery-operated torch into your hand. \"`4Good luck.`0\"`n`nThe door closes gently behind him, and a faint `iclick`i is heard.`n`nYou flick on the torch and take a few steps away from the single overhead lamp.`n`nYou begin the long walk down the corridor. Before long the red carpet runs out, leaving you walking on a bare concrete floor.`n`nAs you proceed further away from the light, the corridor becomes narrower, and cracks appear every few feet in the plaster. Another half a minute of putting one foot in front of the other, and you look down to find that you're now walking on steel treadplate.`n`nYou mark off the cracks in the walls as you proceed, noting their increasing frequency. Within another minute, the walls are crumbling away to reveal a cold chain-link fence, behind which, nothing but darkness.`n`nYou feel the steel give way to rust which bends worryingly beneath your feet, little pieces of dead metal sticking to your boots and falling back with a quiet tinny rustling.`n`nYou still cannot see the end of the corridor.`n`nThe sour metallic scent of oily, corroded metal lingers around oxidized chain-link fences. You tread warily around the holes in the floor; even with your torch, you can't see what's underneath the thinning treadplate. You see something shining in the distance, and quicken your pace. A heavy steel door.`n`nYou look back over your shoulder. You cannot see the entrance. Through the steel door, then. You grip the handle to the right, and pull.`n`nYou hadn't realized how silent this place was until you opened the door; a throaty rushing noise issued from its tracks as corroded bearings spun in dust-blackened oil. You step through.`n`nIs the battery in your torch dying?`n`nYou pull out your lighter, and ignite.`n`nThe flame is a dull, dirty orange, plumes of soot-darkened smoke billowing from your mundane, butane-driven lighter.`n`nYou tell yourself that the torch is not dying; its cone of light is not dimming to a deep orange, not turning redder and dimmer by the second. None of that is happening.`n`nThe torch is just as bright as ever. The problem is that the darkness is getting thicker.`n`nWithin seconds you are blind, and aware of how far away you are from other people, and medical attention.`n`nAware that if you get knocked out here, you won't be going to the FailBoat.`n`nYou feel the hot, damp breath on your face before you hear the growl.`n`n");
addnav("Continue");
addnav("Continue", "runmodule.php?module=proveyourself&op=beginfighting");
break;
case "beginfighting":
$session['user']['gems']--;
restore_buff_fields();
$badguy = array();
$badguy['creaturename'] = "Nightmare";
$badguy['creatureweapon'] = "Serrated Blades";
$badguy['creaturelevel'] = 1;
$badguy['creaturegold'] = 0;
$badguy['creatureexp'] = 0;
$badguy['creaturehealth'] = 1000000000000.0;
$badguy['creatureattack'] = 1;
$badguy['creaturedefense'] = 1;
$badguy['hidehitpoints'] = 1;
calculate_buff_fields();
$badguy['playerstarthp'] = $session['user']['hitpoints'];
$badguy['diddamage'] = 0;
$badguy['type'] = 'nightmare';
$badguy['creatureaiscript'] = "require(\"ai/nightmare.php\");";
$session['user']['badguy'] = createstring($badguy);
$battle = true;
break;
case "run":
output("You can't run from your nightmare.`n`n");
$op = "fight";
httpset('op', $op);
$battle = true;
break;
case "fight":
$battle = true;
break;
case "end":
$points = httpget("points");
$highscore = get_module_pref("highscore");
output("You regain your senses while rolling around on the floor, waving your weapon at the empty air. You're at the end of the corridor. You look back to see the entryway not thirty feet away, and your Mutant friend striding along the corridor.`n`n\"`4Feeling better now?`0\"`n`n\"`#What the `ihell`i was in that drink?`0\"`n`n\"`4Died, did you? Ah, well. It's an experience, anyway.`0\" He looks around at the chunks you've taken out of the walls. \"`4Well, I reckon you knocked about %s hitpoints out of your imagination. Naturally it'll all go on the Hall O' Fame.`0\"`n`nYou take a deep breath and begin to point a recriminating finger. After a moment you shrug, get to your feet and leave, smacking the Mutant around the back of the head as you go.`n`n", $points);
if ($points > $highscore) {
output("`4You beat your personal record!`0`n`n");
set_module_pref("highscore", $points);
}
addnav("Exit");
addnav("Back to the Outpost", "village.php");
break;
case "hof":
page_header("Nightmare Enthusiasts");
$acc = db_prefix("accounts");
$mp = db_prefix("module_userprefs");
$sql = "SELECT {$acc}.name AS name,\r\n\t\t\t\t{$acc}.acctid AS acctid,\r\n\t\t\t\t{$mp}.value AS highscore,\r\n\t\t\t\t{$mp}.userid FROM {$mp} INNER JOIN {$acc}\r\n\t\t\t\tON {$acc}.acctid = {$mp}.userid \r\n\t\t\t\tWHERE {$mp}.modulename = 'proveyourself' \r\n\t\t\t\tAND {$mp}.setting = 'highscore' \r\n\t\t\t\tAND {$mp}.value > 0 ORDER BY ({$mp}.value+0)\t\r\n\t\t\t\tDESC limit 200";
$result = db_query($sql);
$rank = translate_inline("Damage Points");
$name = translate_inline("Name");
output("`n`b`c`4Nightmare Enthusiasts`0`n`n`c`b");
rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center'>");
rawoutput("<tr class='trhead'><td align=center>{$name}</td><td align=center>{$rank}</td></tr>");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($row['name'] == $session['user']['name']) {
rawoutput("<tr class='trhilight'><td>");
} else {
rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td align=left>");
}
output_notl("%s", $row['name']);
rawoutput("</td><td align=right>");
output_notl("%s", number_format($row['highscore']));
rawoutput("</td></tr>");
}
rawoutput("</table>");
addnav("Back to HoF", "hof.php");
villagenav();
break;
}
if ($battle) {
include_once "battle.php";
if ($defeat) {
addnav("You have been killed.");
$session['user']['hitpoints'] = $session['user']['maxhitpoints'];
$points = 1000000000000.0 - $badguy['creaturehealth'];
addnav("What happens next?", "runmodule.php?module=proveyourself&op=end&points=" . $points);
} else {
if ($victory) {
addnav("Now what?");
addnav("What happens next?", "runmodule.php?module=proveyourself&op=end&points=" . $points);
} else {
require_once "lib/fightnav.php";
fightnav(true, true, "runmodule.php?module=proveyourself", true);
}
}
}
page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:proveyourself.php
示例10: applebob_run
function applebob_run()
{
require_once 'lib/villagenav.php';
global $session;
$op = httpget('op');
$cost = get_module_setting('cost');
$eatAllowed = get_module_setting('allowed');
$eatToday = get_module_pref('ate_today');
page_header("Sichae's Apple Stand");
output("`&`c`bApple Bobbing Stand`b`c");
switch ($op) {
case 'bob':
increment_module_pref('ate_today', 1);
$session['user']['gold'] -= $cost;
debuglog("spent {$cost} gold on an apple.");
$appleChance = e_rand(1, 10);
$color = e_rand(1, 4);
$colors = [1 => '`4red', 2 => '`2green', 3 => '`^yellow', 4 => '`@green'];
output("`7You hand Sichae your %s gold, and place your hands on the edge of the barrel.", $cost);
output("Taking a deep breath, you plunge your head forwards into the chilly water, and vainly attempt to grab hold of an apple with your teeth.");
output("You finally emerge from the water with a %s`7 coloured apple in your mouth, gasping for breath.", $colors[$color]);
output("Sichae smiles at your success.`n`n");
output("`&\"Well done, fair warrior!\"`n`n");
if ($appleChance == 1) {
output("`7She grins mischievously, `&\"'Tis a rare warrior that plucks the hallowed blue apple!");
output("There you have my finest achievement.");
output("Go forth and slay all in your path, enchanted one!\"`n`n");
output("`7Your jaw slackens in astonishment at the thought of a blue apple, but you manage to catch the fruit in one hand as it falls.");
output("As you do, its delicious flavor hits you with surprise.");
output("Your muscles tingle and a warm buzz flows into your very bones.`n`n");
output("You feel `5mystical!");
apply_buff('sichae', ['name' => '`!Blue Apple Mystique', 'rounds' => 20, 'defmod' => 1.03, 'roundmsg' => '`!The Blue Apple\'s power tingles in your bones.']);
apply_buff('sichae', array("name" => "`!Blue Apple Mystique", "rounds" => 20, "defmod" => 1.03, "roundmsg" => "`!The Blue Apple's power tingles in your bones."));
} else {
if ($color == 4) {
output("`7As she says this though, you realize that something is very odd about this apple.");
output("It looks and tastes just like an ordinary green apple, but you begin to feel very strange.`n`n");
output("Bizarre creatures appear before your eyes.");
output("You realize that someone has poisoned the apple!`n`n");
output("All of the imaginary monsters from your nightmares close in on you, and you feel the terrifying urge to flee this place!");
apply_buff('sichae', ['name' => '`@Poisoned Appled', 'rounds' => 20, 'defmod' => 0.97, 'roundmsg' => '`@Strange hallucinations taunt you as you fight.']);
blocknav(
|
请发表评论