|
Kaputchnik Beginner
Joined: 06 Jan 2002 Posts: 28 Location: Sweden
|
Posted: Thu Mar 14, 2002 11:56 pm
Trigger problem - Battle rounds |
I want to calculate my average damage done per round. I've been trying to work it out but to no avail. The problem is that I can get all from 0 to 2(3 or four if it's a double round) attacks. Hard to explain I better give an output of the mud and you can see for youself:
--------------------------------------
You crush Ore sorter with your Talin Mace for 17 HPs damage.
Ore sorter missed you.
Ore sorter missed you.
You crush Ore sorter with your Talin Mace for 19 HPs damage.
You kick Ore sorter in the stomach for 9 HPs.
--------------------------------------
Ofcourse I can also miss, and the npc can hit through my armour and damage me. The triggers should calculate the hits that do damage on the vitim. For instance this would display 2 rounds and the avg. damage would be 22.5. The calculations and such I can do myself, but I havn't come up with a decent way of counting rounds. Anybody that have any idea how this can by done? I've tried using triggers with condition but I can't get them to count rounds.
Cheers,
Kaputchnik |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Mar 15, 2002 1:46 am |
A few simple questions you should ask yourself:
Do I always know what my swings will look like? Answer should be yes for hits, misses and specials.
Do I always know whaat mob swings will look like? If your mud doesn't have many aggro mobs then the answer should definitely be yes, even if it does you should be able to establish a few valid patterns.
Do I always swing first on mobs? Truly mud dependent, but very answerable.
So with those conclusion now you can script...
#TR {your swing pattern, might need one for each hit and miss} {#T+ MobSwingPattern;#ALARM "RoundTimeOut" {+2} {round ended by time out}}
#TR "mobswingpattern" {the pattern for mob swings, should be general enough that only 1 trigger covers every possibilty} {#T- mobswingpattern;round ended because mobs have swung, only good solution if you always swing first}
And there you have the way of it. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Mar 15, 2002 3:11 am |
How do you engage NPCs in your MUD? Will mobs attack you on-sight or only when you specifically attack them? If you have to specifically attack them to begin combat, then it becomes SOOO much easier to count the rounds.
#trigger {You {crush|maim|eviscerate|etc} * with your * for (%d) HPs damage.} {#if (@combat.status) {#NOOP you are already in combat;#ADD Combat.roundnumber 1} {#NOOP you are now entering combat;Combat.status = 1;Combat.roundnumber = 1};#ADD combat.dmgdealt %1}
Now, if you are lucky enough that you play on a MUD where NPCs can also initiate combat, then in order to get the true boundary of the round you need to also capture the pattern line and compare that to the line triggered upon.
#trigger {You ({crush|maim|eviscerate|etc}) (*) with your (*) for (%d) HPs damage.} {#if (@combat.status) {#NOOP you are already in combat;#IF (@Combat.roundstart ~= "You ({crush|maim|eviscerate|etc}) (*) with your (*) for (%d) HPs damage.") {#NOOP this is the beginning of the round;#ADD Combat.roundnumber 1} {#NOOP this is not the beginning, so do nothing here}} {#NOOP you are now entering combat;Combat.status = 1;Combat.roundstart = %trigger;Combat.roundnumber = 1};#ADD combat.dmgdealt %1}
Untested unless proven otherwise.
EDIT: forgot to explain what the red text was for. %trigger (predefined variable) holds the line that matched the last trigger to fire. It might be better to replace it with a hard copy of the pattern along the lines of what's checked for earlier in the trigger script.
li'l shmoe of Dragon's Gate MUD |
|
|
|
Kaputchnik Beginner
Joined: 06 Jan 2002 Posts: 28 Location: Sweden
|
Posted: Sat Mar 16, 2002 4:29 pm |
Thanks for the inputs, tried both, but made the second one work. It seemed easier to manage.
Cheers,
Kaputchnik |
|
|
|
|
|