| 1234567891011121314151617181920212223242526272829303132 |
- def status_list
- # Create Status lists
- # Split Statuses by stackable, and non-stackable, saving only their names
- stackable, non_stackable = Status.all.partition { |s| s.amount }
- # Push the categorized Statuses into embed fields
- fields = []
- unless stackable.empty?
- fields.push(
- { name: 'Stackable Effects', value: stackable.map(&:name).join(', ')}
- )
- end
- unless non_stackable.empty?
- fields.push(
- { name: 'Non-Stackable Effects', value: non_stackable.map(&:name).join(', ')}
- )
- end
- # Create Embed
- Embed.new(
- title: 'Statuses',
- fields: fields
- )
- end
- def status_details(status)
- Embed.new(
- title: status.name,
- description: "#{status.effect.capitalize}\n(Stacks: #{status.amount})"
- )
- end
|