ID:1642077
 
(See the best response by FKI.)
Code:
mob/var
list/abilities=list()

mob/proc/add_ability(var/i as num)
switch(i)
if("2")
src.abilities+="bash"
if("5")
src.abilities+="swing"
if("10")
src.abilities+="tackle"

mob/verb/test_abilities()//random example!
add_ability(src.lvl)
var/choose=input("Use which ability") in src.abilities
switch(choose)
if("bash")
//src.bash() attack
if("swing")
//src.swing() attack
if("tackle")
//src.tackle() attack


Problem description: The thing is I am not sure if using a switch statement for inside a text string inside a list is the best way to choose an ability from a list. I don't think having abilities as text strings in a list is so good. Maybe I should use a datum for this one? Btw, I haven't gotten the hang of datums yet.

Unlike this one where I use a proc using an object's use verb instead of a text string to check if the item is in the list as a text:

obj
verb/use(mob/m)
potion
name="Potion"
use(mob/m,mob/source)
var/HP=rand(10,100)
m.hp+=HP
m << "[source] used [name] on you to restore your hp by [HP]"
medicine
name="Medicine"
use(mob/m,mob/source)
m << "[source] used medicine on you"

mob/verb/use_item(mob/m in view(10))
var/obj/item=input("Which item use?") in src.contents
item.use(m)
You need to think about how your system will work more in order to begin planning this.

How do you need to access the abilities?
How will you select them?
How will you execute them?
Best response
You could make your abilities a datum and have them activate through clicking or double-clicking. You could also have your items used through clicking.

Use of verbs like that is ugly, in my honest opinion. Unless your game is meant to be based on verbs, I don't recommend that approach. Also, what Pirion said.