Let me think if I can come up with a "final" approach here.... How about:
Boarder Level = Player Level scaled by Difficulty (Journeyman = 1.0)
Please provide values, I'd say:
difficulty ranges between 1-4 so:
difficulty*5+5
this will have the boarder at level 10 for easy games while its level 25 for difficult games.
This is done now with the help of @TingyunBoarder Type = based on captain type:
- NAVY: "guard" with focus is 100% on fighting skills, so toughest possible enemies
- PIRATE: "abordage" with focus halfway on fighting skills, so medium enemies
- MERCHANT: "citizen" (or possibly a new "sailor" type?) with focus NOT at all on fighting skills, so easiest possible enemies
This is how it's done now:Boarder HP Bonus = value based on ratio between ship morales.
OPTIONAL: Include ratio of boarding skills.
There should be a min/max limit on how much this can be scaled so that enemies aren't too strong/weak.
This limit can be skipped for Swashbuckler.
Code:
ResetMaxHP(mchr); // just in case
ResetMaxHP(echr); // this is being set way too low on easy difficulty
boarding_player_hp = LAi_GetCharacterMaxHP(mchr); // restored original game code
boarding_enemy_hp = CHAR_START_HITPOINTS + (boarding_erank - 1) * CHAR_HITPOINTS_PER_LEVEL; // normal hitpoint calc based on level
SDLogIt("Original enemy HP = " + boarding_enemy_hp + ", enemy rank = " + boarding_erank + ", difficulty = " + GetDifficulty() + ", player rank = " + mchr.rank);
// KK -->
// LDH - playerHP should be left alone. EnemyHP is scaled by difficulty and morale differences.
if (!IsTown) {
boarding_enemy_hp += boarding_enemy_hp * ((stf(echr.ship.crew.morale) - stf(mchr.ship.crew.morale))/200.0); // LDH - change from absolute morale diff to percentage diff, 0.5 to 1.5 - 19Jan09
boarding_enemy_hp = boarding_enemy_hp * (1.0 + (GetDifficulty()-1.0)/5.0)); // 1.0, 1.2, 1.4, 1.6
} else {
boarding_enemy_hp = boarding_enemy_hp + ((makefloat(GetTownCrewMorale(echr.town)) - stf(mchr.ship.crew.morale))/4.0); // fix parenthesis as above
boarding_enemy_hp = boarding_enemy_hp * (1.0 + (GetDifficulty()-1.0)/5.0)); // 1.0, 1.2, 1.4, 1.6
}
//SDLogIt("Final enemy HP = " + boarding_enemy_hp + ", emorale = " + echr.ship.crew.morale + ", mmorale = " + mchr.ship.crew.morale + ", morale change = " + (stf(echr.ship.crew.morale)-stf(mchr.ship.crew.morale))/2.0 + " percent"); // LDH changed 19Jan09
// <-- KK
if (boarding_enemy_hp < LAI_DEFAULT_HP) boarding_enemy_hp = LAI_DEFAULT_HP; // 40
This is how it's handled now:Number of Boarders = based on ratio between crew sizes.
There should be a limit so this ratio is never more than 1:3. This limit can be skipped for Swashbuckler.
Code:
maxcrew = GetBoardingLimit(locIndex);
float CrewRatio = fclamp(1.0/3.0, 2.0/3.0, 1.0 * mcrew / (mcrew + ecrew)); // No more than 2:1 odds on any deck
mcrew = makeint(CrewRatio * maxcrew + 0.5);
ecrew = makeint((1.0 - CrewRatio) * maxcrew + 0.5);
if (mcrew < 1) mcrew = 1;
if (ecrew < 1) ecrew = 1;
int crewtotal = mcrew + ecrew;
SDLogIt("locIndex = " + locIndex + ", Maxcrew = " + maxcrew + ", CrewRatio = " + CrewRatio + ", mcrew = " + mcrew + ", ecrew = " + ecrew + ", total = " + crewtotal);
// LDH - this is where the boarding actor numbers are set
boarding_enemy_crew = ecrew;
boarding_enemy_crew_start = ecrew;
boarding_player_crew = mcrew;
boarding_player_crew_start = mcrew;
For now we don't do this.Boarder Weapons = based on captain type:
- NAVY: Get period-correct soldier weapons. Could make for excessive loot, but these are ALSO the toughest enemies, so having a larger reward is OK.
- PIRATE and MERCHANT: Get random weapons based on nation.
some more questions:
This piece of code is now only called for friendly characters as far as I see:
Code:
{
// added by MAXIMUS [abordage mod] -->
if ((boarderindex_val == 0) || (boarderindex_val == 100)) boarder_num++;
switch(boardermodel_val)
{
case "skeleton": gmodel = SelectBoardingGroup("skel", 1, 4, boarder_num, "man"); model = ExtractBoarderModel(gmodel); break;
case "corsair": gmodel = SelectBoardingGroup("corsair", 1, 5, boarder_num, "man"); model = ExtractBoarderModel(gmodel); break;
case "marine": gmodel = SelectBoardingGroup("rn_warnt18_", 1, 5, boarder_num, "man"); model = ExtractBoarderModel(gmodel); break;
case "masked": gmodel = SelectBoardingGroup("mask_", 2, 4, boarder_num, "man"); model = ExtractBoarderModel(gmodel); break;
case "girl": gmodel = SelectBoardingGroup("towngirl", 1, 7, boarder_num, "woman"); model = ExtractBoarderModel(gmodel); break;
case "soldier": gmodel = SelectBoardingSoldiers(iNation, boarder_num); model = ExtractBoarderModel(gmodel); break;
case "boarder": gmodel = SelectBoardingBoarders(boarder_num); model = ExtractBoarderModel(gmodel); break;
case "standard": model = LAi_GetBoardingModel(mchr, &ani); break;
}
// added by MAXIMUS [abordage mod] <--
}
Shouldn't this be added to the enemies as well?