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 #875439 ยป 0015-Add-the-new-UnitState-property-MovedThisTurn.patch

Sveinung Kvilhaugsvik, 2020-05-28 03:11 PM

View differences:

common/fc_types.h
#define SPECENUM_VALUE5NAME "OnNativeTile"
#define SPECENUM_VALUE6 USP_NATIVE_EXTRA
#define SPECENUM_VALUE6NAME "InNativeExtra"
#define SPECENUM_VALUE7 USP_MOVED_THIS_TURN
#define SPECENUM_VALUE7NAME "MovedThisTurn"
#define SPECENUM_COUNT USP_COUNT
#include "specenum_gen.h"
common/metaknowledge.c
/* Known if the unit is seen by the player. */
return target_unit && can_player_see_unit(pow_player, target_unit);
case USP_HAS_HOME_CITY:
case USP_MOVED_THIS_TURN:
/* Known to the unit's owner. */
return target_unit && unit_owner(target_unit) == pow_player;
case USP_COUNT:
fc_assert_msg(req->source.value.unit_state != USP_COUNT,
common/reqtext.c
_("Requires that the unit isn't in a native extra."));
}
return TRUE;
case USP_MOVED_THIS_TURN:
fc_strlcat(buf, prefix, bufsz);
if (preq->present) {
cat_snprintf(buf, bufsz,
_("Requires that the unit has moved this turn."));
} else {
cat_snprintf(buf, bufsz,
_("Requires that the unit hasn't moved this turn."));
}
return TRUE;
case USP_COUNT:
fc_assert_msg(preq->source.value.unit_state != USP_COUNT,
"Invalid unit state property.");
common/requirements.c
tile_has_native_base(unit_tile(target_unit),
unit_type_get(target_unit)));
break;
case USP_MOVED_THIS_TURN:
return BOOL_TO_TRISTATE(target_unit->moved);
case USP_COUNT:
fc_assert_msg(uprop != USP_COUNT, "Invalid unit state property.");
/* Invalid property is unknowable. */
......
* "Missile+In native extra") */
_("In native extra"));
break;
case USP_MOVED_THIS_TURN:
/* TRANS: unit state. (appears in strings like
* "Missile+Has moved this turn") */
cat_snprintf(buf, bufsz, _("Has moved this turn"));
break;
case USP_COUNT:
fc_assert_msg(psource->value.unit_state != USP_COUNT,
"Invalid unit state property.");
doc/README.effects
DiplRel is a diplomatic relationship.
MaxUnitsOnTile is about the number of units present on a tile.
UnitState is "Transported", "Transporting", "OnNativeTile", "OnLivableTile",
"InNativeExtra", "OnDomesticTile" or "HasHomeCity".
"InNativeExtra", "OnDomesticTile", "MovedThisTurn" or "HasHomeCity".
Activity is "Idle", "Pollution", "Mine", "Irrigate", "Fortified", "Fortress", "Sentry",
"Pillage", "Goto", "Explore", "Transform", "Fortifying", "Fallout", "Base", "Road",
"Convert", "Cultivate", or "Plant".
......
"InNativeExtra" is fulfilled if the unit is on a tile with an extra native
to it.
"OnDomesticTile" is fulfilled if the unit is on a tile owned by its player.
"MovedThisTurn" is fulfilled if the unit has moved this turn.
"HasHomeCity" is fulfilled if the unit has a home city.
    (1-1/1)