Help Needed
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Help Needed
I am trying to make a macro that does this effect. can someone help me?
This unit takes 50% less BLADE DAMAGE when attacked by a melee skill
This unit takes 50% less BLADE DAMAGE when attacked by a melee skill
Re: Help Needed
Code: Select all
#define ABILITY_BLADERESIST2
[resistance]
id=bladeresist
multiply=2
apply_to=blade
[filter_base_value]
greater_than=0
[/filter_base_value]
name= _ "steadfast"
female_name= _ "female^steadfast"
description= _ "Steadfast:
This unit’s blade resistance is doubled when defending. Vulnerabilities are not affected."
affect_self=yes
active_on=defense
[/resistance]
Re: Help Needed
Thanks a lot!
is there a way it can be a weapon ability as well, that is what im aiming at mostly but if not ill accept what you have given me.
once again thank you.
is there a way it can be a weapon ability as well, that is what im aiming at mostly but if not ill accept what you have given me.
once again thank you.
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: Help Needed
You can just place that in the [specials] when defining the weapon in the .cfg (and rename it, if you want).
Re: Help Needed
Warning: the code I gave will break your game, as I missplaced my #enddef. Use this instead:
Code: Select all
#define ABILITY_BLADERESIST2
[resistance]
id=bladeresist
multiply=2
apply_to=blade
[filter_base_value]
greater_than=0
[/filter_base_value]
name= _ "steadfast"
female_name= _ "female^steadfast"
description= _ "Steadfast:
This unit’s blade resistance is doubled when defending. Vulnerabilities are not affected."
affect_self=yes
active_on=defense
[/resistance]
#enddef
Help Needed.... Again
is there a macro that increases your damage as your HP goes down?
Re: Help Needed
in fact doing that as a weapon special will be more efficient, as kapoues code is more leaky than he thinks, simply use the [damage] tag with a multiply=0.5 applied to the opponent (see wiki for details)
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
Re: Help Needed.... Again
Merged your two threads; please keep all your questions in one thread.allanate wrote:is there a macro that increases your damage as your HP goes down?
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: Help Needed.... Again
Not that I know of, but can be easily done.allanate wrote:is there a macro that increases your damage as your HP goes down?
Re: Help Needed
Kapoue_II, your answer is wrong.
allanate wants that his unit received half blade damage, but after your code, unit will receive 0-100% blade damage.
Example: If basic blade resistance Will be 10%, then with your ability ABILITY_BLADERESIST2 blade damage will be not 50% but 80%.
Who can help with this question? It is interesting to me too. How to create ability which will decrease damage on 50%, and this abillity must to work when units resistance will be 0-40% too.
allanate wants that his unit received half blade damage, but after your code, unit will receive 0-100% blade damage.
Example: If basic blade resistance Will be 10%, then with your ability ABILITY_BLADERESIST2 blade damage will be not 50% but 80%.
Who can help with this question? It is interesting to me too. How to create ability which will decrease damage on 50%, and this abillity must to work when units resistance will be 0-40% too.
Re: Help Needed
This should work. I haven't tested it though.
Code: Select all
#define RESIST_MELEE_BLADE_50
[dummy]
id="resist_melee_blade_50"
name="melee blade resistance"
name_inactive="melee blade resistance"
description="This unit takes 50% less damage from melee blade attacks."
description_inactive="This unit takes 50% less damage from melee blade attacks."
[/dummy]
[/abilities]
[event]
name="attack"
first_time_only=false
[filter]
ability="resist_melee_blade_50"
[/filter]
[filter_attack]
range="melee"
[/filter_attack]
[lua]
code=<<
local u = wesnoth.get_variable "unit"
old_res = u.resistance.blade
u.resistance.blade = math.max ( 0, old_res - 50 )
>>
[/lua]
[/event]
[event]
name="attack"
first_time_only=false
[filter_second]
ability="resist_melee_blade_50"
[/filter_second]
[filter_attack]
range="melee"
[/filter_attack]
[lua]
code=<<
local u = wesnoth.get_variable "second_unit"
old_res = u.resistance.blade
u.resistance.blade = math.max ( 0, old_res - 50 )
>>
[/lua]
[/event]
[event]
name="attack_end"
first_time_only=false
[filter]
ability="resist_melee_blade_50"
[/filter]
[filter_attack]
range="melee"
[/filter_attack]
[lua]
code=<<
local u = wesnoth.get_variable "unit"
u.resistance.blade = old_res
old_res = nil
>>
[/lua]
[/event]
[event]
name="attack_end"
first_time_only=false
[filter_second]
ability="resist_melee_blade_50"
[/filter_second]
[filter_attack]
range="melee"
[/filter_attack]
[lua]
code=<<
local u = wesnoth.get_variable "second_unit"
u.resistance.blade = old_res
old_res = nil
>>
[/lua]
[/event]
[+abilities]
#enddef