Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #script_calculate_castle_prosperities_by_using_its_villages
  2. (
  3. "calculate_castle_prosperities_by_using_its_villages", #This is called from within decide_faction_ai, or from
  4. [
  5. (try_for_range, ":cur_castle", castles_begin, castles_end),
  6. (assign, ":total_prosperity", 0),
  7. (assign, ":total_villages", 0),
  8.  
  9. (try_for_range, ":cur_village", villages_begin, villages_end),
  10. (party_get_slot, ":bound_center", ":cur_village", slot_village_bound_center),
  11. (eq, ":cur_castle", ":bound_center"),
  12.  
  13. (party_get_slot, ":village_prosperity", ":cur_village", slot_town_prosperity),
  14.  
  15. (val_add, ":total_prosperity", ":village_prosperity"),
  16. (val_add, ":total_villages", 1),
  17. (try_end),
  18.  
  19. (try_begin),
  20. (store_div, ":castle_prosperity", ":total_prosperity", ":total_villages"),
  21. (else_try),
  22. (assign, ":castle_prosperity", 50),
  23. (try_end),
  24.  
  25. (party_set_slot, ":cur_castle", slot_town_prosperity, ":castle_prosperity"),
  26. (try_end),
  27. ]),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement