<body>
		';
    $sql = "SELECT text FROM statistics ORDER BY page ASC";
    $result = $db->query($sql);
    while ($row = $db->fetch_array($result)) {
        eval("?>" . $row["text"] . "<?");
    }
    echo '
		</body>
		
		</html>
		';
}
if ($action == "getskill") {
    $sql = "SELECT {$gdSpecialCreatureSelect}, a.name AS aname FROM summons AS s, creatures AS c, races AS r, {$db_previousage_accounts} AS a WHERE s.account = a.id AND s.mods != '' AND s.creature = c.id AND c.race = r.id";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    echo 'Adding ', $numrows, ' Nethers...<br>';
    $acc["creaturedisplay"] = 1;
    echo '<table border="0" cellspacing="0" cellpadding="0">';
    unset($array);
    while ($row = $db->fetch_array($result)) {
        $creature = new creature($row);
        $skill = $creature->data["sortskill"];
        $creature->echoCreature();
        $sql = "INSERT INTO nethers (sid, skill) VALUES ('{$row['id']}', '{$skill}')";
        $nresult = $db->query($sql);
    }
    echo '</table>';
}
        } else {
            if ($numrows == 0) {
                echo 'There are no creatures defending this building right now.<br>';
            } else {
                tBegin();
            }
            unset($array);
            while ($row = $db->fetch_array($result)) {
                $creature = new creature($row);
                $array[count($array)] = $row;
                $array[count($array) - 1]["skill"] = $creature->data["sortskill"];
            }
            gSortCreatures($array, TRUE);
            for ($m = 0; $m < count($array); $m++) {
                $row = $array[$m];
                $creature = new creature($row);
                if (($row["aid"] == $acc["id"] || $acc["leadertype"] >= 1 && is_null($acc[x])) && !$underattack) {
                    $url = array("#creaturename", " (<a href=\"index.php?page=playerinfo&action=viewinfo&aid=", "#aid", "\">", "#aname", "</a>, <a href=\"index.php?page=kingdom&action=removecreaturehatchery&sid=", "#id", "\">remove</a>)");
                } else {
                    $url = array("#creaturename", " (<a href=\"index.php?page=playerinfo&action=viewinfo&aid=", "#aid", "\">", "#aname", "</a>)");
                }
                $creature->echoCreature($url);
            }
            if ($numrows != 0) {
                echo '</table>';
            }
        }
        tEnd();
    }
}
if ($action == "donateegg") {
        $output = 'Creatures successfully resurrected!<br>';
        unset($action);
    }
}
if ($action == "resurrect") {
    $no = 0;
    gNoTravel($acc["x"], $acc["y"]);
    $sql = "SELECT {$gdCreatureSelect} FROM (summons AS s, creatures AS c, races AS r) LEFT JOIN accitems AS ai ON ai.account = '{$acc['id']}' AND s.item = ai.id LEFT JOIN items AS i ON ai.item = i.id WHERE s.id = '{$sid}' AND s.account = '{$acc['id']}' AND s.creature = c.id AND c.race = r.id ORDER BY c.name ASC";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows != 1) {
        $output .= 'Invalid data.<br>';
        $no = 1;
    } else {
        $row = $db->fetch_array($result);
        $creature = new creature($row);
        $power += round($creature->powerSkill() * gdResurrectMultiplier);
        if ($power > $acc["power"]) {
            $output .= 'You don\'t have enough power to resurrect that creature.<br>';
            $no = 1;
        }
        if ($creature->data["status"] == 4) {
            $output .= 'An attacking creature can\'t be resurrected.<br>';
        }
        if ($creature->data["dead"] != 1) {
            $output .= 'That creature isn\'t dead!<br>';
            $no = 1;
        }
    }
    if ($no == 0) {
        $acc["power"] -= $power;
 /** ustawia pass na true, zwieksza ap++
  * @return int
  */
 public function pass()
 {
     $this->pass = true;
     return parent::get_ap() + 1;
 }
Exemple #5
0
require_once 'witcher.php';
include_once 'creature.php';
include_once 'eliksir.php';
session_start();
$speed = $_POST['speed'];
$str = $_POST['str'];
$agi = $_POST['agi'];
$live = $_POST['live'];
$p = '<p>';
$o = '</p>';
$witcher = new witcher($speed, $str, $agi, $live, $live);
$speedCrt = $_POST['speedCrt'];
$strCrt = $_POST['strCrt'];
$agiCrt = $_POST['agiCrt'];
$liveCrt = $_POST['liveCrt'];
$monster = new creature($speedCrt, $strCrt, $agiCrt, $liveCrt, $liveCrt);
echo $p . 'Witcher: ' . $o;
//. 'Potwór: <br>'. $monster->stats() ;
$witcher->stats();
echo $p . 'Potwor: ' . $o;
$monster->stats();
$_SESSION['witcher'] = serialize($witcher);
$_SESSION['monster'] = serialize($monster);
static $count = 0;
$_SESSION['count'] = serialize($count);
$_SESSION['eliksir'] = serialize(new eliksir(null, null));
?>
<form action="game.php" >
    <button type="submit" >
        Play
    </button>
Exemple #6
0
                while ($row = $db->fetch_array($result)) {
                    $attackers[count($attackers)] = $row;
                }
                tBegin("General Information");
                $killed = $kdb["waves"] - 1;
                echo '
					We have surrounded the Easter Pigeon and his dreadful minions.<br>
					The Easter Pigeon is still heavily guarded so we\'re going to have to slaughter a lot more pigeons to get to it.<br>
					We have already killed ', $killed, ' waves.<br>
					';
                tEnd();
                tBegin("Wave {$kdb['waves']}");
                tBegin();
                for ($m = 0; $m < count($attackers); $m++) {
                    echo '<tr><td colspan="2">';
                    $attacker = new creature($attackers[$m]);
                    if ($attacker->data["accid"] == 3584) {
                        $url = array("Attacker: ", "#creaturename");
                    } else {
                        $url = array("Attacker: ", "#creaturename", " (<a href=\"index.php?page=playerinfo&action=viewinfo&aid=", "#accid", "\">", "#accname", "</a>)");
                    }
                    tBegin();
                    $attacker->echoCreature($url);
                    echo '</table>';
                    echo '</td></tr>';
                    echo '
						<tr><td width="15"></td><td>
						<br><a href="index.php?page=nest&action=selectdefender&sid=', $attacker->data["id"], '">Attack this pigeon.</a>
						</td></tr>
						';
                    echo '<tr height="20"><td colspan="2"></td></tr>';
        tEnd();
    }
}
if ($action == "step2") {
    tBegin("Step 2: hide creatures");
    echo '
		Now you have to select which creatures you want to hide from the searching eye of your opponent.
		Hidden creatures cannot be seen until all the unhidden creatures have been defended.
		You can hide certain creatures for tactical purposes, but it will cost you some power, depending on the strength of the creature.
		<br><br>
		<form method="post" name="hideform" action="index.php?page=battles&action=launch&bid=', $id, '&key=', $key, '">
		';
    tBegin();
    for ($m = 0; $m < count($array); $m++) {
        $row = $array[$m];
        $creature = new creature($row);
        $url = array("<input type='hidden' name='summon", "#id", "' value='attack'>", "<input onClick='calculate(", "#id", ",", $creature->powerSkill(), ")' type='checkbox' name='hidden", "#id", "'>&nbsp;&nbsp;", "#creaturename");
        $creature->echoCreature($url);
    }
    echo '</table><br><br>';
    echo 'Total Power Cost:&nbsp;&nbsp;&nbsp;<input type="text" class="input" name="powercost" size="10" value="', $totalskill, '"><br><br>';
    echo '
		<input class="input" type="submit" name="submit" value="Attack!">
		</form>
		';
    // power cost javascript function
    echo '
		<script language="JavaScript">
		var gdHideCostMultiplier = ', $gdHideCostMultiplier, ';
		hidden = new Array(0);
		powercost = parseInt(document.hideform.powercost.value);