Er... wait a minute. Protecting someone would include attacks... right...
Anyway, it would hardly be more difficult to add blockading. All you would do is an if function to see if the player is at war, and if its false you temporarily add the mothership's power to the player you are protecting. If it turns out true, you add the mothership's power to the player that is fighting the player you;re protecting. All the other stuff could be before that if statement.
This is what you do:
In the database, there is one cell per player to indicate who they are blockading/protecting. If it equals 0, you are protecting nobody. If it equals, say, 38083 then you are protecting/blockading player 38083.
Easy enough?
Now you just add the following (adapted for the database) in the battle formula:
Code: Select all
$x = mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `protecting`="+$id));
$y = $x;
while($y > 0) {
if($relation="war") then {
$enemy_mship_power = mysql_result(mysql_query("SELECT * FROM `users` WHERE `protecting`="+$id),$x,"mship_power");
$enemy_mship_shields = mysql_result(mysql_query("SELECT * FROM `users` WHERE `protecting`="+$id),$x,"mship_shielding");
} else {
$player_mship_power = mysql_result(mysql_query("SELECT * FROM `users` WHERE `protecting`="+$id),$x,"mship_power");
$player_mship_shields = mysql_result(mysql_query("SELECT * FROM `users` WHERE `protecting`="+$id),$x,"mship_shielding");
}
$y--;
}Now, everywhere I put "user" or "protecting" or whatever in the mysql statements it was probably wrong. Admin would have to adjust this alot. Also, I'm not sure how relations work (probably a seperate table) so I didn't put anything at all likely.
Anyway, my point is that it would actually be pretty easy to do. Especially if admin sees this, he can just copy adapt it for his own ideas.
But it will get complicated to code if people start saying things like, "Each mothership shoudl have its own behaviours!" Let me tell you... IT IS NOT SIMPLE TO DO THAT. Stick with Amon's idea... The power's just stack.
As for casualties, something nobody has discussed yet, they should be evenly distributed between the players, rounded up. (The whole point is extra devestation, no?). If a player loses all his sheilds or weapons (not likely) we could even rule that he loses his mothership. If not, his weapons and sheilds just fly right back to zero.
I would provide code for tha too but I'm too lazy. Sorry admin
Edit: there would also be this some code added so that you don't keep your mothership while protecting someone... that could be... chaotic. But that is, once again, a simple if statement that goes along with the normal if statement to determine if a player has a mothership.







