COMBAT
Ship To Planet Combat
Beams are fired:
a. Attacker's beams vs planet's fighters.
b. Planet's beams vs ½ attacker's fighters.
c. Attacker's remaining beams vs planet's shields.
d. Planet's remaining beams vs attacker's shields.
e. Planet's remaining beams vs attacker's armor.
Torpedos are fired:
a. Attacker's torpedoes vs planet's remaining fighters.
b. Planet's torpedoes vs ½ attacker's remaining fighters.
c. Planet's torpedoes vs attacker's remaining armor.
d. Attacker's remaining torpedoes vs planet's remaining fighters
(see below).
Fighters are launched
a. Attacker's remaining fighters vs planet's remaining fighters.
b. Attacker's remaining fighters vs planet's remaining shields.
c. Planet's remaining fighters vs attacker's remaining armor.
Ship to Ship Combat
1. Ship to ship combat happens in a very straightforward
manner. I'll be using the following method to determine who is the
attacker and who is the defender. a_shields is attacker shields.
d_shields is defender shields.
First, a_engines and d_engines are compared. A chance
to attack is determined by this formula: success=(10d_engines+a_engines)*5.
This number is then compared to a random number between 1 and 100.
If the random number is higher than the success number, the attack
goes on. Otherwise you get a message saying "Target out maneuvered
you!".
2. Here's an example. If your engines are 13 and
his engines are 16, then we calculate the success rate as (1016+13)*5.
The result is 35. Hence, you have a 65% chance (35% chance to fail)
to succeed.
Second, a_sensors and d_cloak are compared. A chance to attack is
determined by this formula: success=(10d_cloak+a_sensors)*5. This
number is then compared to a random number between 1 and 100. If
the random number is lower than the success number, the attack goes
on. Otherwise you get a message saying "Unable to get a lock
on target!".
Here's an example. If your sensors are 7 and his
cloak is 3, then we calculate the success rate as (103+7)*5. This
result is 70. This means you have a straight 70% chance of success.
I know this looks the same as the above engines
check, but here you get the success percent right away. There you
have to subtract from 100. Looks like two different people wrote
this code. Incidentally, there's always at least a 5% success or
5% failure chance. Nothing is certain.
3 . Okay, now combat is a go. If the defender has an Emergency Warp
Device, it is used and the defender is sent to a random sector between
1 and the max sector number, which is 5000 in this game. Combat,
of course, would end. If the defender has no Emergency Warp Devices,
combat is continued.
4. First, beams are exchanged against fighters. The a_beams will
destroy up to half of the d_fighters and vice versa.
For example, you have 20,000 beams and he has 14,000
fighters. Your beams will take out 7,000 fighters (half) and leave
you with 13,000 beams left over. If you had 20,000 beams and he
had 47,000 fighters, you would take out 20,000 fighters. That would
leave you with 0 beams and leave him with 27,000 fighters.
5. This step only happens if either player has any beams left. Assume
we have beams left. The a_beams will go against d_shields. If the
beams are higher, they will negate all of the shields and there
will still be some beams left over. The same thing goes for the
defender's beams against your shields.
For example, you have 7,000 beams left over from
the previous step. Your opponent has 20,000 shields. Your beams
would take away 7,000 shield points and your beams would be done.
If he had had only 6,000 shields, your beams would have taken away
all shields and left you with 1,000 beams left over.
6. This step also only happens if there are beams left over from
the previous two steps. In this step, a_beams are matched up against
d_armor. If your beams are greater than his armor, then he is going
to die. If your beams aren't high enough, you just take away that
many points of armor.
For example, you have 3,000 beams left over and
the opponent has 40,000 armor. You'll take away 3,000, leaving him
with 37,000 armor. If he had 3,000 armor or less, he would die in
the conflict. Death equates to an armor rating of 0 or less.
7. Now we have an exchange of torpedoes. In this version of the
game (blacknova.net 3/6/01) torps have a damage rating of 10. This
is something that can be changed in the config file, so it might
not always be the same. First off, torp damage is calculated by
multiplying the number of torps you have by the torp damage rate.
So, if you had 400 torps, your torp damage would be 4,000 (400*10).
If the defender has any fighters left, the torp
damage will take out up to half of them. It's basically the same
as with the beams. So, if your torp damage is 4,000 and d_fighters
is 5,000, you will take out 2,500 fighters. That'll leave you with
1,500 worth of torp damage to work with. If he had had 10,000 fighters,
you would have taken out a full 4,000 of them. You wouldn't have
any torp damage left though.
8. If you have any torp damage left, it is applied to the defender's
armor. So, if you had 4,000 torp damage left, you'd take away 4,000
armor.
9. Now, fighters attack. Your original fighters total is subtracted
from his fighter total, and his original total is deleted from yours.
This might not seem immediately intuitive, but it is. I'll give
some examples.
You have 40,000 and he has 36,000. You'll end up
with 4,000 left over and he'll end up with 0.
You have 20,000 and he has 20,000. You'll both end up with 0.
You have 15,000 and he has 27,000. You'll end up with 0 and he'll
end up with 12,000.
10. If there are any fighters left, they are applied to the defender's
armor. So, if you have 34,000 fighters left, you can do 34,000 damage
to d_armor. If the defender doesn't have enough armor left, too
bad.
11. The last step is to test whether or not either player is dead.
If either player has armor of 0 or less, they are dead. If you die,
life sucks. You learned a hard lesson. If your opponent dies and
you live, you get some money based on salvaging his ship. If you
want to know how much, look in the code. I'm tired.
