コード例 #1
0
ファイル: dojo.php プロジェクト: ninjajerry/ninjawars
     }
     echo "<hr><br>\n";
     // *** End of Class Changing Code. ***
 }
 //*/
 echo "<a href=\"chart.php\">Upgrade Chart</a><hr>\n";
 $MAX_LEVEL = 250;
 $nextlevel = getLevel($username) + 1;
 $in_upgrade = in('upgrade');
 if ($in_upgrade && $in_upgrade == 1) {
     if ($nextlevel > $MAX_LEVEL) {
         $msg = "There are no trainers that can teach you beyond your current skill. You are legend among the ninja.<br>\n";
     } else {
         if (getKills($username) >= getLevel($username) * 5) {
             subtractKills($username, getLevel($username) * 5);
             addLevel($username, 1);
             addStrength($username, 5);
             addTurns($username, 50);
             addHealth($username, 100);
         } else {
             echo "You do not have enough kills to proceed at this time.<br>\n";
         }
     }
 } else {
     if ($nextlevel > $MAX_LEVEL) {
         $msg = "You enter the dojo as one of the elite ninja. No trainer has anything left to teach you.<br>\n";
     } else {
         if (getKills($username) < getLevel($username) * 5) {
             $msg = "Your trainer finds you lacking. You are instructed to prove your might against more ninja before you return.<br>\n";
         } else {
             echo "<form id=\"level_up\" action=\"dojo.php\" method=\"post\" name=\"level_up\">\n";
コード例 #2
0
ファイル: versenador.php プロジェクト: JJ/Senado.info
// Orden aleatorio
generateCloud($arr, 8, 35);
?>
				</div>

				<div class="actividad_senador">
					<div class="intervenciones">

						<div id="chart_div"></div>
					
						<h2><span><?php 
echo $ints_senador;
?>
</span> intervenciones</h2>
						<?php 
addLevel();
$current = "";
foreach ($int_senador as $item) {
    $fase = $item['fase'];
    if ($current != $fase) {
        if ($current) {
            decLevel();
        }
        $current = $fase;
        addTitle($fase);
    }
    addItem($item['titulo'], "http://www.senado.es/" . $item['url']);
}
if ($current) {
    decLevel();
}
コード例 #3
0
ファイル: lib_player.php プロジェクト: reillo/ninjawars
function level_up_if_possible($char_id, $auto_level = false)
{
    // Setup values:
    $max_level = maximum_level();
    $health_to_add = 100;
    $turns_to_give = 50;
    $stat_value_to_add = 5;
    $char_kills = get_kills($char_id);
    if ($char_kills < 0) {
        // If the character doesn't have any kills, shortcut the levelling process.
        return false;
    } else {
        $char_obj = new Player($char_id);
        $username = $char_obj->name();
        $char_level = $char_obj->level();
        if ($auto_level && $char_obj->isAdmin()) {
            // If the character is an admin, do not auto-level them.
            return false;
        } else {
            // For normal characters, do auto-level them.
            // Check required values:
            $nextLevel = $char_level + 1;
            $required_kills = required_kills_to_level($char_level);
            // Have to be under the max level and have enough kills.
            $level_up_possible = $nextLevel <= $max_level && $char_kills >= $required_kills;
            if ($level_up_possible) {
                // ****** Perform the level up actions ****** //
                // Explicitly call for the special case of kill changing to prevent an infinite loop.
                $userKills = change_kills($char_id, -1 * $required_kills, $auto_level_check = false);
                $userLevel = addLevel($char_id, 1);
                change_strength($char_id, $stat_value_to_add);
                change_speed($char_id, $stat_value_to_add);
                change_stamina($char_id, $stat_value_to_add);
                change_karma($char_id, 1);
                // Only add 1 to karma via levelling.
                change_ki($char_id, 50);
                // Add 50 ki points via levelling.
                addHealth($char_id, $health_to_add);
                addTurns($char_id, $turns_to_give);
                // Send a level-up message, for those times when auto-levelling happens.
                send_event($char_id, $char_id, "You levelled up!  Your strength raised by {$stat_value_to_add}, speed by {$stat_value_to_add}, stamina by {$stat_value_to_add}, Karma by 1, and your Ki raised 50!  You gained some health and turns as well!  You are now a level {$userLevel} ninja!  Go kill some stuff.");
                return true;
            } else {
                return false;
            }
        }
    }
}
コード例 #4
0
ファイル: Refresh.php プロジェクト: The-Nico26/Caranille
    $characterMagic = $character->getMagic();
    $characterAgility = $character->getAgility();
    $characterDefense = $character->getDefense();
    $characterWisdom = $character->getWisdom();
    $characterExperience = $character->getExperience();
    $characterSkillPoint = $character->getSkillPoint();
    $characterGold = $character->getGold();
    $characterTownID = $character->getTownID();
    $characterChapter = $character->getChapter();
    //MIS A JOUR STRENGTH PLAYER
    updateStrengthCharacter($bdd, $character, $characterID);
    //GLOBALES VARIABLES OF TOWN
    $townID = $town->getID();
    $townPicture = $town->getPicture();
    $townName = $town->getName();
    $townDescription = $town->getDescription();
    $townPriceInn = $town->getPriceInn();
    $townChapter = $town->getChapter();
    //VERIFICATION OF THE NEXT LEVEL
    $levelExperience = findLevel($bdd, $characterLevel, $characterExperience, $characterID);
    $nextLevel = $levelExperience - $characterExperience;
    if ($nextLevel <= 0) {
        addLevel($bdd, $levelExperience, $characterID);
        updateAllStats($bdd, $characterID);
        header("Location: {$linkRoot}/Modules/Main/index.php");
    }
    //VERIFICATION OF MESSAGE PRIVATE
    $totalMessagePrive = verifyMessagePrivate($bdd, $accountID);
    //VERIFICATION OF WARNING
    $totalWarning = verifyWarning($bdd, $accountID);
}