Is hoisting another nation flag close to another ship not considered a traitorous action?
If I recall, Hornblower was being condemned to death for that by Napoleon in "A Ship of the Line"/"Flying Colours".
Why should you need to change flags to accept a surrender anyway? If the surrendering ship was previously hostile to you, you should be able to accept the surrender.
If the surrendering ship was
not previously hostile to you, then they thought you were your friend and therefore "accepting their surrender" could be considered traitorous.
After all, they don't know you might
normally be hostile to their nation.
Imagine you join a battle between the Dutch and French under a Dutch flag. You are actually hostile with
both nations.
A Dutch ship surrenders, so you hoist either your personal flag or a French flag in order to accept this surrender.
Consider how that looks to them: For all they knew, you were a friend!
Anyway, here's the relevant code:
Code:
if(Ship_GetDistance2D(pchar, chr) <= visibility_range)
{
//If you hoist an enemy flag close to other ships, they will remenber you and recognise you next time
if(CheckAttribute(Pchar,"flagchanged") && GetNationRelation(sti(pchar.nation), sti(chr.nation)) == RELATION_ENEMY)
{
chr.recognized = 1;
chr.EnemyShipName = Pchar.Ship.Name;
chr.EnemyShipType = Pchar.Ship.Type;
// PB: Only do this close to enemy ships
if(sti(chr.nation) != PIRATE) PChar.traitor = chr.nation; // marker for recognizing feature
}
}
// SCREWFACE : Check if you have been previously recognized
//if(GetRMRelationType(GetActualRMRelation(sti(characters[Ships[i]].nation))) == RELATION_ENEMY && Checkattribute(&characters[Ships[i]],"recognized"))
if(Checkattribute(chr, "recognized") && !CheckAttribute(chr,"surrendered"))
{
if(chr.EnemyShipName == Pchar.Ship.Name && chr.EnemyShipType == Pchar.Ship.Type)
{
SetCharacterRelationBoth(sti(PChar.index), Ships[i], RELATION_ENEMY);
}
}
If you changed your flag AND this makes you hostile, then the enemy ship recognizes you and you are marked as a traitor.
Then if that ship hadn't already surrendered, they will turn hostile.
We can also reduce the penalty for being recognized for doing this, such as making you deal with only the town guards and not the citizens.
Possible things to add:
- Check if that ship was hostile to you
before you changing your flag
- Check if that ship is hostile to your personal nation
- Check if bMapEnter is true, which checks if you are locked in battle (or locked in a storm)
If the PChar.Ship.Cannons.fired_time is larger then a certain number it should trigger. Else you probally are in battle already.
I'm not sure how the fired_time is stored. Have to look at up. But say for example you haven't fired your guns in 3 hours (ingame) then probally you aren't in battle.
I think that is used for the "cannon ready" sounds and I know for sure those don't work right. Wouldn't recommend using that.