コード例 #1
0
 $killer->update_stat("money_gained", $killed->credits);
 if ($debug) {
     print "credit the kill to attacker<br>";
 }
 // add a kill
 $db->query("UPDATE player SET kills = kills + 1 WHERE account_id = {$killer_id} AND game_id = {$player->game_id}");
 if ($debug) {
     print "send message to attacker<br>";
 }
 // send dead msg
 $killed->send_message($killer->account_id, MSG_PLAYER, format_string("You <span style=\"color:red;\">DESTROYED</span> {$killed_name} in Sector&nbsp<span style=\"color:blue;\">#{$curr_sector}</span>", false));
 if ($debug) {
     print "send message to defender<br>";
 }
 //send them a nice message
 $killer->send_message($killed_id, MSG_PLAYER, format_string("You were <span style=\"color:red;\">DESTROYED</span> by {$killer_name} in Sector&nbsp<span style=\"color:blue;\">#{$curr_sector}</span>", false));
 if ($debug) {
     print "change alignment<br>";
 }
 // now we change align
 // @ war? bring it up @ peace? go down @ neutral? check aligns
 $killer->get_relations();
 if ($killer->relations_global[$killed->race_id] <= -300) {
     $modifier = $killer->relations_global[$killed->race_id] / -25;
 } elseif ($killer->relations_global[$killed->race_id] >= 300) {
     $modifier = $killer->relations_global[$killed->race_id] / -25;
 } else {
     $modifier = $killed->alignment / -10;
 }
 $db->query("UPDATE player SET alignment = alignment + {$modifier} WHERE account_id = {$killer_id} AND game_id = {$player->game_id}");
 if ($debug) {