To skill: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle No edit summary |
imported>Eliteofdelete No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 12: | Line 11: | ||
return_type={{#var:return_type}}| | return_type={{#var:return_type}}| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param| | parameter1={{Param|int|convert}}| | ||
}}| | }}| | ||
function2={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|string|convert}}| | |||
}}| | |||
function3={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|effect|convert}}| | |||
p1desc={{Pspan|convert}} is the int, string or effect to convert| | |||
}}| | |||
function_description=When supplied an int or string, returns the skill that corresponds to the specified parameter {{pspan|convert}}. When supplied an effect, this returns the skill that, when cast on a player, gives them the effect {{pspan|convert}}.| | |||
code1={{CodeSample| | |||
title=Code Samples| | |||
description=Following example shows basic to_skill operations.|| | |||
code= | |||
<syntaxhighlight> | |||
int first; | |||
string second; | |||
effect third; | |||
first = 53; | |||
second = "disco eye"; | |||
third = $effect[she-who-was]; | |||
print(first+" gives "+to_skill(first)+".", "blue"); | |||
print(second+" gives "+to_skill(second)+".", "blue"); | |||
print(third+" gives "+to_skill(third)+".", "blue"); | |||
</syntaxhighlight>| | |||
moreinfo= | |||
It gives the following output. | |||
<pre> | |||
53 gives Summon Crimbo Candy. | |||
disco eye gives Disco Eye-Poke. | |||
Avatar of She-Who-Was gives Turtle Power. | |||
</pre> | |||
}}| | |||
special=If {{pspan|convert}} cannot be given by use of a skill and is supplied as such, or no match is found for a supplied string or int type, this function returns $skill[ none ].| | |||
}} | }} | ||
[[Category:Datatype Conversions]] |
Latest revision as of 15:43, 26 January 2015
Function Syntax
skill to_skill(string convert )
skill to_skill(effect convert )
- convert is the int, string or effect to convert
When supplied an int or string, returns the skill that corresponds to the specified parameter convert. When supplied an effect, this returns the skill that, when cast on a player, gives them the effect convert.
Code Samples
Following example shows basic to_skill operations.
int first;
string second;
effect third;
first = 53;
second = "disco eye";
third = $effect[she-who-was];
print(first+" gives "+to_skill(first)+".", "blue");
print(second+" gives "+to_skill(second)+".", "blue");
print(third+" gives "+to_skill(third)+".", "blue");
It gives the following output.
53 gives Summon Crimbo Candy. disco eye gives Disco Eye-Poke. Avatar of She-Who-Was gives Turtle Power.
Special
If convert cannot be given by use of a skill and is supplied as such, or no match is found for a supplied string or int type, this function returns $skill[ none ].