Example #1
0
function showSuccessNotifications()
{
    print "<b>Congrats, you have successfully completed the mission </b><br>";
    print "You gained " . $_SESSION['baseCashGained'] . " cash <br>";
    print "You gained " . $_SESSION['baseExpGained'] . " exp <br>";
    if (isset($_SESSION['gainedLootItemID'])) {
        $item = Item::getItem($_SESSION['gainedLootItemID']);
        print "Lucky you! You received a " . $item->getName() . "<br>";
        unset($_SESSION['gainedLootItemID']);
    }
    if (isset($_SESSION['itemsLost'])) {
        $itemsLostArray = $_SESSION['itemsLost'];
        $itemsLost = Item::getItems($itemsLostArray);
        foreach ($itemsLost as $item) {
            print "You lost a " . $item->getName() . "<br>";
            unset($itemsLostArray[$key]);
        }
        unset($_SESSION['itemsLost']);
    }
    print "You used " . $_SESSION['energyLost'] . " energy <br>";
    print "<br><br>";
    unset($_SESSION['baseCashGained']);
    unset($_SESSION['baseExpGained']);
    unset($_SESSION['energyLost']);
    unset($_SESSION['missionsuccess']);
}
Example #2
0
function getItemStats($topItems, $statType)
{
    $itemObjs = Item::getItems(array_keys($topItems), $statType);
    $totalStat = 0;
    foreach ($itemObjs as $item) {
        $itemID = $item->getID();
        if ($statType == "attack") {
            $stat = $item->getAtkBoost();
        } else {
            if ($statType == "defense") {
                $stat = $item->getDefBoost();
            }
        }
        $totalStat += $stat * $topItems[$itemID];
    }
    return $totalStat;
}
Example #3
0
?>
	<url>
		<loc><?php 
echo SITE_URL;
?>
/nyheder</loc>
		<lastmod><?php 
echo date("Y-m-d", strtotime($item["modified_at"]));
?>
</lastmod>
		<changefreq>daily</changefreq>
		<priority>1</priority>
	</url>
<?
// POSTS
$items = $IC->getItems(array("itemtype" => "post", "status" => 1)); 
foreach($items as $item):
?>
	<url>
		<loc><?php 
echo SITE_URL;
?>
/nyheder/<?php 
echo $item["sindex"];
?>
</loc>
		<lastmod><?php 
echo date("Y-m-d", strtotime($item["modified_at"]));
?>
</lastmod>
		<changefreq>daily</changefreq>
Example #4
0
    if ($_SESSION['won'] == 'true') {
        echo "Congratulations! You won! <br>";
        echo "You gained " . $_SESSION['expGained'] . " experience! <br>";
    } else {
        echo "Sorry, you lost. <br>";
    }
    unset($_SESSION['won']);
}
function ItemAtkCmp($item1, $item2)
{
    return $item1->getAtkBoost() - $item2->getAtkBoost();
}
// display the items used in the battle
if (isset($_SESSION['userUsedItems']) && isset($_SESSION['otherUserUsedItems'])) {
    $userItemObjs = Item::getItems(array_keys($_SESSION['userUsedItems']));
    $otherUserItemObjs = Item::getItems(array_keys($_SESSION['otherUserUsedItems']));
    // usort returns a bool
    usort($userItemObjs, "Item::ItemAtkCmp");
    usort($otherUserItemObjs, "Item::ItemDefCmp");
    echo "Your mob of " . $user->getAgencySize() . " used <br>";
    listItems($userItemObjs, $_SESSION['userUsedItems']);
    $otherUser = User::getUser($_SESSION['otherUserID']);
    // TODO make this a link to the other user's profile page
    echo $otherUser->getName() . "'s mob of " . $otherUser->getAgencySize() . " used <br>";
    listItems($otherUserItemObjs, $_SESSION['otherUserUsedItems']);
    unset($_SESSION['userUsedItems']);
    unset($_SESSION['otherUserUsedItems']);
    unset($_SESSION['otherUserID']);
}
if ($user->getType()) {
    ?>
Example #5
0
function showSuccessNotifications($serverRoot)
{
    $html = '<div class="successmission">
        <h2 class="congrats">Congratulations!</h2>
        ';
    if (isset($_SESSION['levelUp'])) {
        if (isset($_SESSION['prodigy_level'])) {
            displayProdigyAchievement($_SESSION['prodigy_level']);
        }
        if (isset($_SESSION['levelUp'])) {
            $html .= '<div class="skillpoints">
				<h4>You LVL up to ' . $_SESSION['newLevel'] . '!</h4>';
            if (isset($_SESSION['skillPointsGained']) && $_SESSION['skillPointsGained'] > 0) {
                $html .= '<a class="blackbutton skillpointbutton" href="' . $serverRoot . 'profile.php?selectedtab=skillpoints">Spend Skill Points &#187; </a>';
            }
            $html .= '</div>';
        }
        //            $skillPointsGained = $_SESSION['skillPointsGained'];
        unset($_SESSION['newLevel']);
        unset($_SESSION['levelUp']);
    } else {
        $html .= '<h2>Mission Accomplished!</h2>';
    }
    $html .= '<div class="gained">
                    <ul>
                        <li><h3>You gained</h3></li>
                        <li><em>+</em> $' . $_SESSION['baseCashGained'] . '</li>
                        <li><em>+</em> ' . $_SESSION['baseExpGained'] . ' Experience</li>';
    if (isset($_SESSION['skillPointsGained']) && $_SESSION['skillPointsGained'] > 0) {
        $html .= '<li><em>+</em> ' . $_SESSION['skillPointsGained'] . ' Skill points</li>';
        unset($_SESSION['skillPointsGained']);
    }
    if (isset($_SESSION['gainedLootItemID'])) {
        $item = Item::getItem($_SESSION['gainedLootItemID']);
        $html .= '<li><em>+</em> 1 ' . $item->getName() . '</li>
                        <li><img src="' . $item->getImage() . '" /></li>';
        unset($_SESSION['gainedLootItemID']);
    }
    $html .= '    </ul>
                </div>
                <div class="used">
                    <ul>
                        <li><h3>You Lost </h3></li>';
    if (isset($_SESSION['itemsLost'])) {
        $itemsLostArray = $_SESSION['itemsLost'];
        $itemsLost = Item::getItems($itemsLostArray);
        foreach ($itemsLost as $item) {
            $html .= '<li>- ' . $item->getName() . '</li>';
        }
        unset($_SESSION['itemsLost']);
    }
    $html .= '<li>- ' . $_SESSION['energyLost'] . ' Energy</li>';
    if (!isset($_GET['firstmission'])) {
        $missionID = $_GET['missionID'];
        $cityID = $_GET['cityID'];
        $html .= '</ul>
                        <a class="doagain" href="' . $serverRoot . 'backend/domission.php?missionID=' . $missionID . '&currentMissionCity=' . $cityID . '&cityID=' . $cityID . '">Do Again</a>';
    }
    $html .= '</div> ';
    unset($_SESSION['baseCashGained']);
    unset($_SESSION['baseExpGained']);
    unset($_SESSION['energyLost']);
    unset($_SESSION['missionsuccess']);
    return $html;
}