wesnoth-wiki-changes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-wiki-changes] RandomTraitUnit


From: wiki
Subject: [Wesnoth-wiki-changes] RandomTraitUnit
Date: Tue, 16 Nov 2004 19:26 +0100

UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
IP: 216.20.1.212
URI: http://wesnoth.slack.it/?RandomTraitUnit
 - - - - -
For example,
 {RANDOM_TRAIT_UNIT (
 type=Elvish Champion
 x=20
 y=14
 )}
will create an Elvish
Champion with two random traits at 20,14.

NOTE: To create a fully realistic unit, also add 'upkeep=full', and give it a 
name. (Actually I know of no way to
randomly generate fully realistic(to Wesnoth)
names. However you can copy names out of names.cfg into a list for {RANDOM}, 
and use the result as a name. -EP)

 #define LOYAL
        [trait]
        id=loyal
        name= _ "loyal"
                [effect]
                apply_to=loyal
                [/effect]
        [/trait]
 #enddef

 #define STRONG
        [trait]
        id=strong
        name= _ "strong"
                [effect]
                apply_to=attack
                range=short
                increase_damage=1
                [/effect]
                [effect]
                apply_to=hitpoints
                increase_total=2
                heal_full=yes
                [/effect]
        [/trait]
 #enddef

 #define QUICK
        [trait]
        id=quick
        name= _ "quick"
                [effect]
                apply_to=movement
                increase=1
                [/effect]
                [effect]
                apply_to=hitpoints
                increase_total=-10%
                heal_full=yes
                [/effect]
        [/trait]
 #enddef

 #define INTELLIGENT
        [trait]
        id=intelligent
        name= _ "intelligent"
                [effect]
                apply_to=max_experience
                increase=-20%
                [/effect]
        [/trait]
 #enddef

 #define RESILIENT
        [trait]
        id=resilient
        name= _ "resilient"
                [effect]
                apply_to=hitpoints
                increase_total=7
                #make sure the unit starts at full health
                heal_full=yes
                [/effect]
        [/trait]
 #enddef

 #define TRAIT_IF NUMBER DESC TRAIT1 TRAIT2 STATS
 [if]
 [variable]
 name=random
 equals={NUMBER}
 [/variable]
        [then]
        [unit]
        {STATS}
        traits_description= _ "{DESC}"
        [modifications]
        {TRAIT1}
        {TRAIT2}
        [/modifications]
        [/unit]
        [/then]
 [/if]
 #enddef

 #define RANDOM_TRAIT_UNIT STATS
 {RANDOM 1..10}
 {TRAIT_IF 1 quick,resilient ({QUICK}) ({RESILIENT}) ({STATS})}
 {TRAIT_IF 2 strong,resilient ({STRONG}) ({RESILIENT}) ({STATS})}
 {TRAIT_IF 3 loyal,resilient ({LOYAL}) ({RESILIENT}) ({STATS})}
 {TRAIT_IF 4 intelligent,resilient ({INTELLIGENT}) ({RESILIENT}) ({STATS})}
 {TRAIT_IF 5 strong,quick ({STRONG}) ({QUICK}) ({STATS})}
 {TRAIT_IF 6 strong,intelligent ({STRONG}) ({INTELLIGENT}) ({STATS})}
 {TRAIT_IF 7 loyal,strong ({LOYAL}) ({STRONG}) ({STATS})}
 {TRAIT_IF 8 loyal,quick ({LOYAL}) ({QUICK}) ({STATS})}
 {TRAIT_IF 9 loyal,intelligent ({LOYAL}) ({INTELLIGENT}) ({STATS})}
 {TRAIT_IF 10 quick,intelligent ({QUICK}) ({INTELLIGENT}) ({STATS})}
 #enddef

How to do have random unit names:


 # to be used like this:
 # {RANDOM_NAME}
 # [unit]
 # user_description=$randomname
 # ...
 # [/unit]
 # {CLEAR_VARIABLE randomname}

 #define RANDOM_NAME
 [set_variable]
 name=randomname
 random= _ "Names,Go,Here,In,A,List,Like,This"
 [/set_variable]
 #enddef


||See Also||

* UsefulWMLFragments






reply via email to

[Prev in Thread] Current Thread [Next in Thread]