Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #874201

open

Non destructive unit transfer for bribe and capture

Added by Sveinung Kvilhaugsvik about 4 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

unit_change_homecity_handling() transfers unit in a non destructive way. If unit_change_owner() did the same Feature #873295 would become easier to implement.

Side effect of deleting the original target unit and creates a new one: updating loss statistics, cargo saving, transport unloading, emission of the unit_lost signal and player death if the unit is GamleLoss.


Related issues

Related to Freeciv - Feature #873295: Casus_Belli_Success for all actionsNewSveinung Kvilhaugsvik

Actions
Actions #1

Updated by Sveinung Kvilhaugsvik about 4 years ago

Actions #2

Updated by Alexandro Ignatiev about 2 years ago

Well, but the "side effects" become harder to implement. Also, now we can see in "unit_lost" signal the old unit and on the same tile the new unit, that may be used by some script, so it should not be done to d3f branches.

Actions #3

Updated by Alexandro Ignatiev about 2 years ago

Sveinung Kvilhaugsvik wrote:

Side effect of deleting the original target unit and creates a new one: updating loss statistics, cargo saving, transport unloading, emission of the unit_lost signal and player death if the unit is GamleLoss.

Likely, we are not going to emit "unit_lost" signal any more since it has been connected to wipe_unit_full and the script may suppose that the signalized unit soon goes out of existence. We'll probably either emit some new signal (see https://osdn.net/projects/freeciv/ticket/44888 OSDN#44888) or catch target in action_started/finished_unit_unit(s). Currently, capturing loaded units is just not allowed and bribing a ship throws its cargo overboard even if you could bribe an allied ship.

About gameloss units, unique one probably blocks the action, and I'd check what's there with non-unique types of them in current code, meseems some bugs. It might seem logical to wipe them still.

Also available in: Atom PDF