diff --git a/profiles/base-empty.yaml b/profiles/base-empty.yaml index e2005ac69b..c42097853d 100644 --- a/profiles/base-empty.yaml +++ b/profiles/base-empty.yaml @@ -130,3 +130,5 @@ empty_values: zombie: {} script_watch_ignored_scripts: [] custom_clerk_tools: {} + healing_plant_adjectives: [] + healing_plant_nouns: [] diff --git a/profiles/base.yaml b/profiles/base.yaml index 7f0cb91ac9..9efc9eaf6d 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -638,6 +638,18 @@ performance_while_healing: false # use tome.lic while waiting for healing / being healed # assumes you have tome setup properly tome_while_healing: false +# Adjectives and nouns for safe-room healing plants +healing_plant_adjectives: + - vela'tohr + - swaying + +healing_plant_nouns: + - briar + - bush + - plant + - shrub + - thicket + - thornbush # override the repair location to use instead of hometown force_repair_town: diff --git a/safe-room.lic b/safe-room.lic index 817b480f9c..cfac5e019f 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -22,8 +22,11 @@ class SafeRoom @stop_performance_after_heal = false @tome_while_healing = settings.tome_while_healing @stop_tome_after_heal = false - - @plant_regex = /vela'tohr (briar|bush|plant|shrub|thicket|thornbush)/ + @plant_adjectives = settings.healing_plant_adjectives + @plant_nouns = settings.healing_plant_nouns + @adjectives_regex = Regexp.union(settings.healing_plant_adjectives) + @noun_regex = Regexp.union(settings.healing_plant_nouns) + @plant_regex = Regexp.new("#{@adjectives_regex} #{@noun_regex}") return unless args.force || need_healing? @@ -210,8 +213,12 @@ class SafeRoom DRC.release_invisibility - if /.*vela.tohr (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s - fput("touch #{Regexp.last_match(1)}") + # Match room objects against the full regex to find and capture the noun + if /#{@adjectives_regex} (\w+)/ =~ DRRoom.room_objs.grep(@plant_regex).to_s + plant_type = Regexp.last_match(1) + + # Send touch command for the captured noun + fput("touch #{plant_type}") if @plant_nouns.include?(plant_type) end # check for safe-room idle thing to do