Ejemplo n.º 1
0
		addhistory(($badguy['playerstarthp']-$session['user']['hitpoints'])/max($session['user']['maxhitpoints'],$badguy['playerstarthp']));
		$badguy=array();
	}else{
		if($defeat){
			addnav("Daily news","news.php");
			$sql = "SELECT taunt FROM taunts ORDER BY rand(".e_rand().") LIMIT 1";
			$result = db_query($sql) or die(db_error(LINK));
			$taunt = db_fetch_assoc($result);
			$taunt = str_replace("%s",($session[user][sex]?"her":"him"),$taunt[taunt]);
			$taunt = str_replace("%o",($session[user][sex]?"she":"he"),$taunt);
			$taunt = str_replace("%p",($session[user][sex]?"her":"his"),$taunt);
			$taunt = str_replace("%x",($session[user][weapon]),$taunt);
			$taunt = str_replace("%X",$badguy[creatureweapon],$taunt);
			$taunt = str_replace("%W",$badguy[creaturename],$taunt);
			$taunt = str_replace("%w",$session[user][name],$taunt);
			addhistory(1);
			addnews("`%".$session[user][name]."`5 has been slain in the forest by $badguy[creaturename]`n$taunt");
			$session[user][alive]=false;
			debuglog("lost {$session['user']['gold']} gold when they were slain in the forest");
			$session[user][gold]=0;
			$session[user][hitpoints]=0;
			$session[user][experience]=round($session[user][experience]*.9,0);
			$session[user][badguy]="";
			output("`b`&You have been slain by `%$badguy[creaturename]`&!!!`n");
			output("`4All gold on hand has been lost!`n");
			output("`410% of experience has been lost!`n");
			output("You may begin fighting again tomorrow.");
			
			page_footer();
		}else{
		  fightnav();
Ejemplo n.º 2
0
 function logdl()
 {
     global $valuser;
     for ($i = 0, $c = count($this->files); $i < $c; $i++) {
         $f2 = new file2($this->files[$i]);
         if ($f2->ifexists()) {
             $fdesc = new filedesc($f2->fname);
             if ($fdesc->logaccess) {
                 $hid = addhistory($valuser->getid(), $f2->sid, 3);
             }
         }
     }
 }
Ejemplo n.º 3
0
     output("You receive `^" . ($badguy['creatureexp'] + $expbonus) . "`# total experience!`n`0");
     $session['user']['gold'] += $badguy['creaturegold'];
     $session['user']['experience'] += $badguy['creatureexp'] + $expbonus;
     $creaturelevel = $badguy['creaturelevel'];
     $_GET['op'] = "";
     //if ($session[user][hitpoints] == $session[user][maxhitpoints]){
     if ($badguy['diddamage'] != 1) {
         if ($session['user']['level'] >= getsetting("lowslumlevel", 4) || $session['user']['level'] <= $creaturelevel) {
             output("`b`c`&~~ Flawless Fight! ~~`\$`n`bYou receive an extra turn!`c`0`n");
             $session['user']['turns']++;
         } else {
             output("`b`c`&~~ Flawless Fight! ~~`b`\$`nA more difficult fight would have yielded an extra turn.`c`n`0");
         }
     }
     $dontdisplayforestmessage = true;
     addhistory(($badguy['playerstarthp'] - $session['user']['hitpoints']) / max($session['user']['maxhitpoints'], $badguy['playerstarthp']));
     $badguy = array();
 } else {
     if ($defeat) {
         addnav("Daily news", "news.php");
         $sql = "SELECT taunt FROM taunts ORDER BY rand(" . e_rand() . ") LIMIT 1";
         $result = db_query($sql) or die(db_error(LINK));
         $taunt = db_fetch_assoc($result);
         $taunt = str_replace("%s", $session['user']['sex'] ? "her" : "him", $taunt['taunt']);
         $taunt = str_replace("%o", $session['user']['sex'] ? "she" : "he", $taunt);
         $taunt = str_replace("%p", $session['user']['sex'] ? "her" : "his", $taunt);
         $taunt = str_replace("%x", $session['user']['weapon'], $taunt);
         $taunt = str_replace("%X", $badguy['creatureweapon'], $taunt);
         $taunt = str_replace("%W", $badguy['creaturename'], $taunt);
         $taunt = str_replace("%w", $session['user']['name'], $taunt);
         addnews("`%" . $session['user']['name'] . "`5 has been slain in the forest by " . $badguy['creaturename'] . "`n{$taunt}");