Advertisement
Guest User

Untitled

a guest
Jan 29th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. t.precondition_restr = utils.parse_names(utils.cfg_get_string
  2. (self.setting_ini, section, "precondition_restr", self, false, "", ""))
  3.  
  4.  
  5.  
  6. function faction_brain_human:get_sim_targets_advance(expansion)
  7.  
  8.  local restr_smrt = {}
  9.  
  10.  for k, v in pairs (expansion.precondition_restr) do
  11.    restr_smrt[v] = true
  12.  end
  13.  
  14.  for k,v in pairs(expansion.precondition_target) do
  15.    local smart_obj = self.faction.board.smarts_by_names[v]
  16.     if not restr_smrt[v] then
  17.       self:register_target_point(smart_obj, true)
  18.     end
  19.  end
  20.  
  21.  for k,v in pairs(expansion.precondition_target_optional) do
  22.    local smart_obj = self.faction.board.smarts_by_names[v]
  23.     if not restr_smrt[v] then
  24.       self:register_target_point(smart_obj, true)
  25.     end
  26.   end
  27.  
  28.   for k,v in pairs(expansion.precondition_target_eliminate) do
  29.     local smart_obj = self.faction.board.smarts_by_names[v]    
  30.     local smart_owner = smart_obj.player_name
  31.     if smart_owner ~= "none" and not restr_smrt[v] then
  32.       if game_relations.is_factions_enemies(self.faction.player_name, smart_owner) then
  33.         self:register_target_point(smart_obj, false, true)
  34.       end
  35.     end
  36.   end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement