TbBool creature_free_for_anger_job(struct Thing *creatng) { struct CreatureControl *cctrl; struct Dungeon *dungeon; cctrl = creature_control_get_from_thing(creatng); dungeon = get_dungeon(creatng->owner); return ((cctrl->spell_flags & CSAfF_Unkn0800) == 0) && (dungeon->must_obey_turn == 0) && ((cctrl->spell_flags & CSAfF_Chicken) == 0) && !thing_is_picked_up(creatng) && !is_thing_passenger_controlled(creatng); }
TbBool thing_is_valid_scavenge_target(const struct Thing *calltng, const struct Thing *scavtng) { if (!thing_is_creature(scavtng) || (scavtng->model != calltng->model)) { return false; } if (!is_neutral_thing(scavtng)) { if (!players_are_enemies(calltng->owner, scavtng->owner)) { return false; } } if (thing_is_picked_up(scavtng)) { return false; } if (is_thing_passenger_controlled(scavtng) || creature_is_kept_in_custody(scavtng)) { return false; } if (is_hero_thing(scavtng) && (!gameadd.scavenge_good_allowed)) { return false; } if (is_neutral_thing(scavtng) && (!gameadd.scavenge_neutral_allowed)) { return false; } struct PlayerInfo *scavplyr; scavplyr = INVALID_PLAYER; if (!is_neutral_thing(scavtng)) { scavplyr = get_player(scavtng->owner); } if (scavplyr->controlled_thing_idx != scavtng->index) { struct CreatureControl *cctrl; cctrl = creature_control_get_from_thing(scavtng); if (game.play_gameturn - cctrl->temple_cure_gameturn > game.temple_scavenge_protection_turns) { return true; } } return false; }