View Source: /source/stables.php

Click here for the source, OR
Other files that you may wish to view the source of:

Source of: /source/stables.php

<?
require_once "common.php";
page_header("Stables");
/*
output("This is the stables.  Every town should have one.  Or so I'm told.");
output("`n`nYou can't do anything here but imagine.  So imagine you can ");
output("leave your horse here, or imagine you can steal someone else's horse, ");
output("or imagine whatever you want, I don't care.  I made stables.");
output("`n`nStable commentary!`n");
commentary("stables","Add Important Stable Talk",25);
*/
//output("Old things have passed away, and new things are coming.`n`nDiscuss the mystery!`n");
//addnav("Go someplace more useful","village.php");

//commentary("stables2","Discuss",25);

addnav("Buy a pony (6 gems)","stables.php?op=buy&level=1");
addnav("Buy a gelding (10 gems)","stables.php?op=buy&level=2");
addnav("Buy a stallion (16 gems)","stables.php?op=buy&level=3");
addnav("Return to the village","village.php");
$horses=array(1=>"pony","gelding","stallion");
$costs=array(1=>6,10,16);
if (
$_GET[op]==""){
    
output("`7Behind the inn, and a little to the left of Pegasus Armor, is as fine a stable as one
    might expect to find in any village.  "
.($session[user][hashorse]?"It was in this stable that you bought your `2".($horses[$session[user][hashorse]])."`7.":"")."
    In it, a burly looking dwarf tends to various horses.
    `n`n
    You approach, and he whirls around, pointing a pitchfork in your general direction, \"`&Ach, 
    sorry m'"
.($session[user][sex]?"lass":"lad").", I dinnae hear ya' comin' up on me, an' I thoht
    fer sure ye were Cedrik; he what been tryin' to improve on his dwarf tossin' skills.  Naahw, wha'
    can oye do fer ya?`7\" he asks.  "
);
}elseif(
$_GET[op]=="buy"){
    if (
$session[user][hashorse]>=$_GET[level]){
        
output("`7\"`&Ach!  Dinnae y' loyke th' `^".$horses[$session[user][hashorse]]."`& oye sold ye?
        Well, tis a shame fer sure, how'eer all sales are foynal.  Sorry "
.($session[user][sex]?"lass":"lad").",`7\"
        the little dwarf says."
);
    }else{
        if (
$session[user][gems]>=$costs[$_GET[level]]){
            
output("`7\"`&Oye, tha' be a foyne lot of gems fer sure!  Oy've got a fine new `^".$horses[$_GET[level]]."`& fer ye.`7\"
            After taking your gems, he leads out the steed he promised.  You pat it on the nose, "
);
            if (
$session[user][hashorse]>0){
                
output(" and head off to the fields to let your ".$horses[$session[user][hashorse]]." loose.");
            }else{
                
output(" and head back to the village.");
            }
            
$session[user][hashorse]=$_GET[level];
            
$session[user][gems]-=$costs[$_GET[level]];
            if (
$session[user][hashorse]>=3) {
                
//$session[user][attack]+=1;
                
output("`n`n`^This horse adds to your attack against monsters!`0`n");
            }
        }else{
            
output("`7\"`&Ach!  Dinnae y' look at th' proyces?  Perhap ye ha' better get some readin' glasses 'afore ye
            troy to engage in commerce!`7\" suggests the dwarf."
);
            
        }
    }
}
page_footer();
?>