Skip to content

Instantly share code, notes, and snippets.

@x1a0
Created February 26, 2017 20:43
Show Gist options
  • Save x1a0/a9c43832d95de01ce1f2417b860dff7a to your computer and use it in GitHub Desktop.
Save x1a0/a9c43832d95de01ce1f2417b860dff7a to your computer and use it in GitHub Desktop.
rw rep
;; enhance entity name card
/def -F -p100 -mregexp -t'^\| A ([a-z]+) (fire|air|water|earth) entity ([a-z]+) with power .+ \|$' x_rw_entity_card_scan=\
/let size=0%;\
/let adjective=0%;\
/if ({P1} =~ 'titchy') /let size=$[size+1]%;\
/elseif ({P1} =~ 'miniscule') /let size=$[size+2]%;\
/elseif ({P1} =~ 'small') /let size=$[size+3]%;\
/elseif ({P1} =~ 'medium') /let size=$[size+4]%;\
/elseif ({P1} =~ 'large') /let size=$[size+5]%;\
/elseif ({P1} =~ 'huge') /let size=$[size+6]%;\
/elseif ({P1} =~ 'enormous') /let size=$[size+7]%;\
/elseif ({P1} =~ 'humongous') /let size=$[size+8]%;\
/elseif ({P1} =~ 'gargantuan') /let size=$[size+9]%;\
/endif%;\
/if ({P3} =~ 'shimmering') /let adjective=$[adjective+1]%;\
/elseif ({P3} =~ 'gleaming') /let adjective=$[adjective+2]%;\
/elseif ({P3} =~ 'sizzling') /let adjective=$[adjective+3]%;\
/elseif ({P3} =~ 'sparkling') /let adjective=$[adjective+4]%;\
/elseif ({P3} =~ 'glittering') /let adjective=$[adjective+5]%;\
/elseif ({P3} =~ 'radiating') /let adjective=$[adjective+6]%;\
/elseif ({P3} =~ 'throbbing') /let adjective=$[adjective+7]%;\
/elseif ({P3} =~ 'pulsating') /let adjective=$[adjective+8]%;\
/elseif ({P3} =~ 'blazing') /let adjective=$[adjective+9]%;\
/endif%;\
/def -i -F -p1 -P2BC$[246+adjective] -n1 \
-mregexp -t'^\\| A [a-z]+ (fire|air|water|earth) entity ([a-z]+) with power .+ \\|$$' =\
/substitute -p %1 %2 @{BC$[246+size]}%3(%{size})@{n} %4 %5 @{BC$[246+adjective]}%6(%{adjective})@{n} $[substr({-6}, 0, 10)] $[substr({-6}, 17)]%;\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment