Feature #579 » 0032-Unhardcode-wld.map-from-action_prob_vs_units.patch
client/control.c | ||
---|---|---|
break;
|
||
case ATK_UNITS:
|
||
if ((ptile = unit_tile(punit))
|
||
&& action_prob_possible(action_prob_vs_units(punit, act, ptile))) {
|
||
&& action_prob_possible(action_prob_vs_units(nmap, punit, act, ptile))) {
|
||
request_do_action(act, punit->id, ptile->index, 0, "");
|
||
}
|
||
break;
|
common/actions.c | ||
---|---|---|
Get the actor unit's probability of successfully performing the chosen
|
||
action on all units at the target tile.
|
||
**************************************************************************/
|
||
struct act_prob action_prob_vs_units(const struct unit *actor_unit,
|
||
struct act_prob action_prob_vs_units(const struct civ_map *nmap,
|
||
const struct unit *actor_unit,
|
||
const action_id act_id,
|
||
const struct tile *target_tile)
|
||
{
|
||
const struct civ_map *nmap = &(wld.map);
|
||
return action_prob_vs_units_full(nmap, actor_unit,
|
||
unit_home(actor_unit),
|
||
unit_tile(actor_unit),
|
||
... | ... | |
switch (action_get_target_kind(paction)) {
|
||
case ATK_UNITS:
|
||
if (tgt_tile) {
|
||
prob = action_prob_vs_units(act_unit, paction->id, tgt_tile);
|
||
prob = action_prob_vs_units(nmap, act_unit, paction->id, tgt_tile);
|
||
}
|
||
break;
|
||
case ATK_TILE:
|
common/actions.h | ||
---|---|---|
const action_id act_id,
|
||
const struct unit *victim);
|
||
struct act_prob action_prob_vs_units(const struct unit* actor,
|
||
struct act_prob action_prob_vs_units(const struct civ_map *nmap,
|
||
const struct unit* actor,
|
||
const action_id act_id,
|
||
const struct tile* victims);
|
||
server/actiontools.c | ||
---|---|---|
const struct extra_type *target_extra,
|
||
bool accept_all_actions)
|
||
{
|
||
const struct civ_map *nmap = &(wld.map);
|
||
if (actor == NULL || target == NULL) {
|
||
/* Can't do any actions if actor or target are missing. */
|
||
return NULL;
|
||
... | ... | |
prob = action_prob_vs_extras(actor, act, target, target_extra);
|
||
break;
|
||
case ATK_UNITS:
|
||
prob = action_prob_vs_units(actor, act, target);
|
||
prob = action_prob_vs_units(nmap, actor, act, target);
|
||
break;
|
||
case ATK_CITY:
|
||
case ATK_UNIT:
|
||
... | ... | |
case ATK_UNITS:
|
||
if (tgt_tile
|
||
&& is_action_enabled_unit_on_units(nmap, act, actor, tgt_tile)) {
|
||
current = action_prob_vs_units(actor, act, tgt_tile);
|
||
current = action_prob_vs_units(nmap, actor, act, tgt_tile);
|
||
}
|
||
break;
|
||
case ATK_TILE:
|
server/unithand.c | ||
---|---|---|
case ATK_UNITS:
|
||
if (target_tile) {
|
||
/* Calculate the probabilities. */
|
||
probabilities[act] = action_prob_vs_units(actor_unit, act,
|
||
probabilities[act] = action_prob_vs_units(nmap, actor_unit, act,
|
||
target_tile);
|
||
} else {
|
||
/* No target to act against. */
|
server/unittools.c | ||
---|---|---|
switch (action_id_get_target_kind(order.action)) {
|
||
case ATK_UNITS:
|
||
prob = action_prob_vs_units(punit, order.action,
|
||
prob = action_prob_vs_units(nmap, punit, order.action,
|
||
dst_tile);
|
||
tgt_id = dst_tile->index;
|
||
break;
|
- « Previous
- 1
- 2
- Next »