Page 1 of 1

naval/air damage table

Posted: Wed Oct 07, 2009 11:43 am
by Michael the Pole
Bleck, as long as you're giving away all the secrets in the store, can you tell us where the table that assigns damage from air attacks on naval units lives?

Can you foresee any immediate consequences (from a programming standpoint) to altering this table?

As you can see, I'm thinking of designing my own naval patch, if I can get some of the "crazed modders" to help me out with some of the actual coding. It has been suggested to me that we can implement some of the suggested changes (ex. restricting ship repairs to one level/turn) as "house rules," which strikes me as brilliant.[&o]

RE: naval/air damage table

Posted: Wed Oct 07, 2009 11:48 am
by doomtrader
IIRC it's hardcoded

RE: naval/air damage table

Posted: Wed Oct 07, 2009 1:44 pm
by Bleck
1. defenderBonus = amount of enemy aircraft carriers in attacked sea zone
2. chanceOfSpotting (global, one time checked) = (6.66 * [attacker country aircraft tech level] * [attacker country navy tech level] * [attacker unit effective strength]) / (first on list enemy naval unit country navy tech level)
3. if Random (range 0 - 99) < chanceOfSpotting then repeat 10 times:
3.1) chance = 5 * [attacker unit effective strength]
3.2) if Random (range 0 - 99) < chance then:
3.2.1) pick random enemy naval unit (defender)
3.2.2) if defender is a sub unit and Random (range 1 - 99) < 50 then cancel this attack (jump to 3.1)
3.2.3) defender.HP = defender.HP - 1
3.2.4) chanceOfDefenderHittingAttacker = ([defender country navy tech level] + defenderBonus) * [attacker effective strength]
3.2.5) if Random (range 0 - 99) < chanceOfDefenderHittingAttacker then:
3.2.5.1) attacker.HP = attacker.HP - 1
Jump to 3.1 if not executed 10 times.