Ejemplo n.º 1
0
$tamagotchi->Calculate();
if ($action == "shower") {
    $showered = $tamagotchi->actionShower();
    $smarty->assign('ACTIONDONE', 'showered');
    $smarty->assign('ACTIONPOINTS', $showered);
    $facebook->api_client->notifications_send($_GET[pet], 'Taken a shower. Yeah.', 'user_to_user');
}
if ($action == "feed") {
    $eaten = $tamagotchi->actionFeed();
    $smarty->assign('ACTIONDONE', 'eaten');
    $smarty->assign('ACTIONPOINTS', $eaten);
    $tokens = array('variable1' => 'value1');
    $facebook->api_client->feed_publishUserAction('59887462220', $tokens);
}
if ($action == "doc") {
    $doc = $tamagotchi->actionDoctor();
    $smarty->assign('ACTIONDONE', 'doc');
    $smarty->assign('ACTIONPOINTS', $doc);
}
if (ereg("play", $action)) {
    $number = split("-", $action);
    $playResult = $tamagotchi->actionPlay($number[1]);
    $doc = $tamagotchi->actionDoctor();
    $smarty->assign('ACTIONDONE', 'played');
    $smarty->assign('ACTIONPOINTS', $playResult);
}
$tamagotchi->Calculate();
$info = $tamagotchi->getData();
$age = $tamagotchi->calculateAgeSize();
// calculate image
$age_minutes_awake = $age[minutes] - $tamagotchi->getNightMinsLifetime();