Advertisement
intangibles

Untitled

Jun 5th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.96 KB | None | 0 0
  1. ## switch_hunting
  2. ## v.01 by Kalros
  3. ## Switch bigshot settings via data stored in YAML config file
  4. ##
  5.  
  6. $switch_hunting_debug = false
  7.  
  8. hunt_settings = YAML.load_file('./scripts/creature-data.yaml') if hunt_settings.nil?
  9. echo hunt_settings if $switch_hunting_debug
  10.  
  11. creature_name = Array.new
  12. #creature_name << ['great stag']
  13. #creature_name << ['greater moor wight', 'lesser moor wight', 'greater fetid corpse', 'colossus vulture']
  14. creature_name << ['agresh bear', 'black leopard']
  15. creature_name << ['crested basiliskTI', 'giant weasel']
  16. creature_name << ['mastodonic leopard', 'dreadnought raptor']
  17. creature_name << ['scaly burgee']
  18. creature_name << ['crested basiliskTV', 'centaur', 'centaur ranger']
  19. total_creatures = creature_name.size
  20. echo creature_name if $switch_hunting_debug
  21. echo "size: #{total_creatures}" if $switch_hunting_debug
  22.  
  23. ## Counters for rotating through the creature list
  24. ## see track_deposit method in common for increase of index
  25. ## using minimum silver values
  26.  
  27. UserVars.creature_index = 0 if UserVars.creature_index >= total_creatures
  28. echo "Creature_index: #{UserVars.creature_index}" if $switch_hunting_debug
  29.  
  30. $global_creature_name = creature_name[UserVars.creature_index]
  31. creature_name = creature_name[UserVars.creature_index]
  32. echo "Hunting: #{creature_name}"
  33. echo creature_name if $switch_hunting_debug
  34.  
  35. ## End index creature_name assignment
  36.  
  37. temp_start_room = nil
  38. temp_boundaries = nil
  39. temp_targets = ""
  40. temp_a = ""
  41. temp_b = ""
  42. temp_c = ""
  43.  
  44. ## Setting some UserVars that sbounty clears
  45. UserVars.op['resting_room_id'] = 20
  46. UserVars.op['wounded_eval'] = "bleeding? || percenthealth <= 60 || ([Wounds.head, Scars.head].max >= 2) || ([Wounds.nsys, Scars.nsys].max >= 2) || ([Wounds.leftArm, Wounds.leftHand, Wounds.rightArm, Wounds.rightHand, Scars.leftArm, Scars.leftHand, Scars.rightArm, Scars.rightHand].max >= 3) || ( ([Wounds.leftArm, Wounds.leftHand, Scars.leftArm, Scars.leftHand].max >= 2) or ([Wounds.rightArm, Wounds.rightHand, Scars.leftArm, Scars.leftHand].max >= 2) )"
  47.  
  48. ## Cross check Areas Hash against Creature Hash to find starting room and boundaries
  49. temp_areas = hunt_settings['Creatures']["#{creature_name[0]}"]['area_name'].join(",")
  50. hunt_settings['Areas'].each do |key, value|
  51.   if temp_areas =~ /#{key}/
  52.     echo key if $switch_hunting_debug
  53.     echo value if $switch_hunting_debug
  54.     $to_hunt_zone = hunt_settings['Areas']["#{key}"]['hunt_zone']
  55.     temp_start_room = hunt_settings['Areas']["#{key}"]['start_room']
  56.     temp_boundaries = hunt_settings['Areas']["#{key}"]['boundaries'].join(",")
  57.   end
  58. end
  59.  
  60. echo temp_areas if $switch_hunting_debug
  61. echo temp_start_room if $switch_hunting_debug
  62. echo temp_boundaries if $switch_hunting_debug
  63. echo $to_hunt_zone
  64.  
  65. ## Append with (a) or (b) to determine where to aim attacks based on skin locations
  66. creature_name.each{|i|
  67.   short = hunt_settings['Creatures'][i]['short_name']
  68.   skin_temp = hunt_settings['Creatures'][i]['skin_location']
  69.   temp_targets << (short + "(a)" + ",") if skin_temp =~ /head/
  70.   temp_targets << (short + "(b)" + ",") if skin_temp =~ /back|chest/
  71.   temp_targets << (short + "(c)" + ",") if skin_temp =~ /flying/
  72. }
  73.  
  74. ## combining the targets into 1 target line if more then 1 target
  75. #temp_targets = (temp_a+temp_b+temp_c).join(",")
  76. #temp_targets = temp_a + "," + temp_b + "," + temp_c if (temp_b != "" or temp_c != "")
  77.  
  78. temp_attackA = 'hide, punch target abdomen'
  79. temp_attackB = 'hide, punch target head'
  80. temp_attackC = 'wait 30, hide, punch target head'
  81.  
  82. ## Move local variables into bigshot settings
  83. UserVars.op['targets']            = temp_targets
  84. UserVars.op['hunting_room_id']    = temp_start_room
  85. UserVars.op['hunting_boundaries'] = temp_boundaries
  86. UserVars.op['hunting_commands']   = temp_attackA
  87. UserVars.op['hunting_commands_b'] = temp_attackB
  88. UserVars.op['hunting_commands_c'] = temp_attackC
  89. UserVars.op['flee_count']         = 99
  90. UserVars.op['rest_till_exp']      = 101
  91. UserVars.op['fried']      = 101
  92. UserVars.op['encumbered']         = 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement