Anti-marksman
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.
Anti-marksman
I wanted to make a 'flailing' weapon special, that was like anti-marksman. No matter how bad at dodging the target is, hit rate never gets above 50%.
I couldn't work out how to do this, so provisionally I set it to always hit at 40%, but that's not what I had in mind. The AbilitiesWML wiki page is more than a little murky on the interaction of the value, add, multiply, and cumulative key-value pairs.
Is there a way to do this?
Alternately, what if I merely wanted to average the hit rate with 40%? Would I use multiply=0.5 and add=40% keys-value pair in the same [chance_to_hit] tag, or should I put them in separate [chance_to_hit] tags, and if so, does order matter?
I couldn't work out how to do this, so provisionally I set it to always hit at 40%, but that's not what I had in mind. The AbilitiesWML wiki page is more than a little murky on the interaction of the value, add, multiply, and cumulative key-value pairs.
Is there a way to do this?
Alternately, what if I merely wanted to average the hit rate with 40%? Would I use multiply=0.5 and add=40% keys-value pair in the same [chance_to_hit] tag, or should I put them in separate [chance_to_hit] tags, and if so, does order matter?
What saves a man is to take a step. Then another step. It is always the same step, but you have to take it. -- You-know-who
The Kingdom Of Loathing Era
The Kingdom Of Loathing Era
Re: Anti-marksman
Code: Select all
[dummy]
id=anti-marksman
name= _ "anti-marksman"
description= _ "Anti-Marksman:
When used offensively, this attack always has at least a 0% chance to hit."
[/dummy]
[event]
name=attack
[filter_attack]
special="anti-marksman"
[/filter_attack]
[if]
[filter_second]
defence=60
[/filter_second]
[or]
[filter_second]
defence=70
[/filter_second]
[/or]
[then]
[store_unit]
[filter_attack]
special=anti-marksman
[/filter_attack]
kill=no
variable=anti-marksman
[/store_unit]
{FORCE_CHANCE_TO_HIT anti-marksman.id "[not]side=anti-marksman.side[/not]" 50}
[/then]
[/if]
[/event]
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
Re: Anti-marksman
No, that will not work. That's pretty much complete nonsense.LightFighter wrote:I think this will work.Code: Select all
[dummy] id=anti-marksman name= _ "anti-marksman" description= _ "Anti-Marksman: When used offensively, this attack always has at least a 0% chance to hit." [/dummy] [event] name=attack [filter_attack] special="anti-marksman" [/filter_attack] [if] [filter_second] defence=60 [/filter_second] [or] [filter_second] defence=70 [/filter_second] [/or] [then] [store_unit] [filter_attack] special=anti-marksman [/filter_attack] kill=no variable=anti-marksman [/store_unit] {FORCE_CHANCE_TO_HIT anti-marksman.id "[not]side=anti-marksman.side[/not]" 50} [/then] [/if] [/event]
Re: Anti-marksman
Are there no ideas on this? I would like not to have flailing just be 'lousy magical' if I can avoid it.
What saves a man is to take a step. Then another step. It is always the same step, but you have to take it. -- You-know-who
The Kingdom Of Loathing Era
The Kingdom Of Loathing Era
-
- Posts: 637
- Joined: December 20th, 2009, 5:59 pm
- Location: Germany
Re: Anti-marksman
Order doesn't matter, as far as I tested (only in [set_variables], but I think, it's all the same), the order of calculate is the following(I haven't beta):drachefly wrote:Alternately, what if I merely wanted to average the hit rate with 40%? Would I use multiply=0.5 and add=40% keys-value pair in the same [chance_to_hit] tag, or should I put them in separate [chance_to_hit] tags, and if so, does order matter?
1. value
2. add
3. multiply
4. divide
So if you want to include the formula this_chance_to_hit=normal_chance_to_hit*50%+40%, you'll need to make something like this:
Code: Select all
[chance_to_hit]
add=80%
multiply=0.5
[/chance_to_hit]
Code: Select all
[chance_to_hit]
add=40%
multiply=0.5
[/chance_to_hit]
Re: Anti-marksman
Thanks!
What saves a man is to take a step. Then another step. It is always the same step, but you have to take it. -- You-know-who
The Kingdom Of Loathing Era
The Kingdom Of Loathing Era