Difference between revisions of "Template:Part"

From TheKolWiki
Jump to: navigation, search
(unfortunately, it still gets optimized out)
(explain how to get more random output from this template)
Line 1: Line 1:
&lt;<bodypart></bodypart>&gt;<noinclude>[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>
+
<includeonly>&lt;<bodypart></bodypart>&gt;</includeonly><noinclude>
 +
 
 +
Generate a random body part, for use with hit and critical hit messages, particularly those for monsters (see {{tl|battle}}). 
 +
 
 +
==Examples==
 +
Due to the way the wiki optimizes the use of this template, one has to use slightly different notation if you want distinct bodyparts to be generated with multiple calls to the template on the same page.
 +
 
 +
*<nowiki>He hits you in the {{part}} and the {{part}}, and then bites you in the {{part}}.  You hate getting bit in the {{part}}.</nowiki>
 +
*:He hits you in the {{part}} and the {{part}}, and then bites you in the {{part}}.  You hate getting bit in the {{part}}.
 +
*<nowiki>He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part|}}.  You hate getting bit in the {{part|}}.</nowiki>
 +
*:He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part|}}.  You hate getting bit in the {{part|}}.
 +
*<nowiki>He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part}}.  You hate getting bit in the {{part}}.</nowiki>
 +
*:He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part}}.  You hate getting bit in the {{part}}.
 +
 
 +
Notice how all calls to <nowiki>{{part}}</nowiki> have the same value in ''all'' of the above examples. However <nowiki>{{part|}}</nowiki> is evaluated randomly each time (but may not always be distinct).  As in the third example, this can be exploited a bit when the message actually intentionally uses the same part in multiple places.
 +
 
 +
[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>

Revision as of 08:37, 16 December 2010


Generate a random body part, for use with hit and critical hit messages, particularly those for monsters (see {{battle}}).

Examples

Due to the way the wiki optimizes the use of this template, one has to use slightly different notation if you want distinct bodyparts to be generated with multiple calls to the template on the same page.

  • He hits you in the {{part}} and the {{part}}, and then bites you in the {{part}}. You hate getting bit in the {{part}}.
    He hits you in the <foot> and the <throat>, and then bites you in the <forehead>. You hate getting bit in the <head>.
  • He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part|}}. You hate getting bit in the {{part|}}.
    He hits you in the <ear> and the <throat>, and then bites you in the <foot>. You hate getting bit in the <neck>.
  • He hits you in the {{part|}} and the {{part|}}, and then bites you in the {{part}}. You hate getting bit in the {{part}}.
    He hits you in the <skull> and the <elbow>, and then bites you in the <throat>. You hate getting bit in the <ear>.

Notice how all calls to {{part}} have the same value in all of the above examples. However {{part|}} is evaluated randomly each time (but may not always be distinct). As in the third example, this can be exploited a bit when the message actually intentionally uses the same part in multiple places.