Feature #893 » 0019-Unhardcode-wld.map-from-action_speculate_unit_on_til.patch
ai/tex/texaicity.c | ||
---|---|---|
{
|
||
int orig_value;
|
||
bool potential_worst_worked = FALSE;
|
||
const struct civ_map *nmap = &(wld.map);
|
||
if (!city_can_work_tile(pcity, ptile)) {
|
||
return;
|
||
... | ... | |
}
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
||
... | ... | |
if (limit == TWTL_BUILDABLE_UNITS) {
|
||
unit_list_iterate(units, punit) {
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit),
|
||
ptile,
|
||
TRUE,
|
||
... | ... | |
if (limit == TWTL_BUILDABLE_UNITS) {
|
||
unit_list_iterate(units, punit) {
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit),
|
||
ptile,
|
||
TRUE,
|
||
... | ... | |
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_removed_by_action(tgt, taction)
|
||
&& action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit), ptile,
|
||
TRUE,
|
||
... | ... | |
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_caused_by_action(tgt, taction)
|
||
&& action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit), ptile,
|
||
TRUE,
|
||
... | ... | |
fc_assert_action(action_get_target_kind(paction) == ATK_TILE,
|
||
break);
|
||
if (action_prob_possible(action_speculate_unit_on_tile(
|
||
paction->id,
|
||
nmap, paction->id,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
||
... | ... | |
fc_assert_action(action_get_target_kind(paction) == ATK_TILE,
|
||
break);
|
||
if (action_prob_possible(action_speculate_unit_on_tile(
|
||
paction->id,
|
||
nmap, paction->id,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
ai/threaded/taicity.c | ||
---|---|---|
{
|
||
int orig_value;
|
||
bool potential_worst_worked = FALSE;
|
||
const struct civ_map *nmap = &(wld.map);
|
||
if (!city_can_work_tile(pcity, ptile)) {
|
||
return;
|
||
... | ... | |
}
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
||
... | ... | |
if (limit == TWTL_BUILDABLE_UNITS) {
|
||
unit_list_iterate(units, punit) {
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit),
|
||
ptile,
|
||
TRUE,
|
||
... | ... | |
if (limit == TWTL_BUILDABLE_UNITS) {
|
||
unit_list_iterate(units, punit) {
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit),
|
||
ptile,
|
||
TRUE,
|
||
... | ... | |
if (removing) {
|
||
as_rmextra_action_iterate(try_act) {
|
||
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_removed_by_action(tgt, taction)
|
||
&& action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit), ptile,
|
||
TRUE,
|
||
... | ... | |
} else {
|
||
as_extra_action_iterate(try_act) {
|
||
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_caused_by_action(tgt, taction)
|
||
&& action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit), ptile,
|
||
TRUE,
|
||
... | ... | |
fc_assert_action(action_get_target_kind(paction) == ATK_TILE,
|
||
break);
|
||
if (action_prob_possible(action_speculate_unit_on_tile(
|
||
paction->id,
|
||
nmap, paction->id,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
||
... | ... | |
fc_assert_action(action_get_target_kind(paction) == ATK_TILE,
|
||
break);
|
||
if (action_prob_possible(action_speculate_unit_on_tile(
|
||
paction->id,
|
||
nmap, paction->id,
|
||
punit, unit_home(punit), ptile,
|
||
TRUE,
|
||
ptile, tgt))) {
|
common/actions.c | ||
---|---|---|
extra) given the specified game state changes.
|
||
**************************************************************************/
|
||
struct act_prob
|
||
action_speculate_unit_on_tile(action_id act_id,
|
||
action_speculate_unit_on_tile(const struct civ_map *nmap,
|
||
action_id act_id,
|
||
const struct unit *actor,
|
||
const struct city *actor_home,
|
||
const struct tile *actor_tile,
|
||
... | ... | |
* current position rather than on actor_tile. Maybe this function should
|
||
* return ACTPROB_NOT_IMPLEMENTED when one of those is detected and no
|
||
* other requirement makes the action ACTPROB_IMPOSSIBLE? */
|
||
const struct civ_map *nmap = &(wld.map);
|
||
if (omniscient_cheat) {
|
||
if (is_action_enabled_unit_on_tile_full(nmap, act_id,
|
common/actions.h | ||
---|---|---|
const struct tile *target);
|
||
struct act_prob
|
||
action_speculate_unit_on_tile(action_id act_id,
|
||
action_speculate_unit_on_tile(const struct civ_map *nmap,
|
||
action_id act_id,
|
||
const struct unit *actor,
|
||
const struct city *actor_home,
|
||
const struct tile *actor_tile,
|
server/advisors/autosettlers.c | ||
---|---|---|
if (adv_city_worker_act_get(pcity, cindex,
|
||
action_id_get_activity(act)) >= 0
|
||
&& action_prob_possible(
|
||
action_speculate_unit_on_tile(act,
|
||
action_speculate_unit_on_tile(nmap, act,
|
||
punit, unit_home(punit),
|
||
ptile,
|
||
parameter.omniscience,
|
||
... | ... | |
if (removing) {
|
||
as_rmextra_action_iterate(try_act) {
|
||
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_removed_by_action(pextra, taction)) {
|
||
/* We do not even evaluate actions we can't do.
|
||
* Removal is not considered prerequisite for anything */
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit),
|
||
ptile,
|
||
... | ... | |
} else {
|
||
as_extra_action_iterate(try_act) {
|
||
struct action *taction = action_by_number(try_act);
|
||
if (is_extra_caused_by_action(pextra, taction)) {
|
||
eval_act = action_id_get_activity(try_act);
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(try_act,
|
||
action_speculate_unit_on_tile(nmap, try_act,
|
||
punit,
|
||
unit_home(punit),
|
||
ptile,
|
||
... | ... | |
dep_tgt = road_extra_get(pdep);
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(ACTION_ROAD,
|
||
action_speculate_unit_on_tile(nmap, ACTION_ROAD,
|
||
punit, unit_home(punit), ptile,
|
||
parameter.omniscience,
|
||
ptile, dep_tgt))) {
|
||
... | ... | |
if (eval_dep_act != ACTIVITY_LAST) {
|
||
if (action_prob_possible(
|
||
action_speculate_unit_on_tile(eval_dep_action,
|
||
action_speculate_unit_on_tile(nmap, eval_dep_action,
|
||
punit, unit_home(punit), ptile,
|
||
parameter.omniscience,
|
||
ptile, pdep))) {
|
||
... | ... | |
ptile));
|
||
case ATK_TILE:
|
||
return action_prob_possible(action_speculate_unit_on_tile(
|
||
paction->id,
|
||
nmap, paction->id,
|
||
punit, unit_home(punit), ptile,
|
||
omniscient_cheat,
|
||
ptile, target));
|
- « Previous
- 1
- 2
- Next »