|
Post by pi4t on Feb 3, 2010 21:43:31 GMT
How would I do specific battle situations such as:
ARCHER 1 SKILL 7 STAMINA 5 ARCHER 2 SKILL 6 STAMINA 7 ARCHER 3 SKILL5 STAMINA 4
Fight archers 1 and 2 hand to hand at the same time. At the same time, archer 3 shoots arrows at you from a safe distance – each attack round roll an additional dice. If you roll a 1 you have been hit by an arrow and must lose 1 stamina. When you have defeated archers 1 and 2, fight archer 3 in the normal way.
There is no time to cast a spell, but if you have a forcefield around you,it will last for 2 attack rounds before it wears off. During this time, you take no damage.
Or:
BARREL SKILL 9 STAMINA 6
Naturally, the barrel will not injure you. Instead, water will continue to seep in and begin to drown you. In the first attack round lose 1 stamina NO MATTER WHAT, in the second 2 etc. (If you have cast spells you will already have begun this process. Continue from where you left off).
|
|
|
Post by Zaphod Beeblbrox on Feb 6, 2010 11:39:18 GMT
OK these are pretty complex situations, and will need complex solutions. I will get back to you with complete tag/script solutions asap, but in the meantime here is how I would approach them. Battle 1: ...is in fact 2 battles, requiring 2 combat calling script tags. The first battle is just a normal combat call against the first 2 archers, but would require an additional script tag with some custom code for the stand-off archer attack. The second battle is of course a stright fight against archer 3. The forcefield is something I will have to get back to you about - it is in fact the hardest aspect of your battle requirements. Battle 2: ...simply a call to the full combat routine specifying that the barrier does 0 damage (remember if you use the full combat call you are best off copy pasting the entire routine from the library into your library and using it from there as it may be subject to change). Again an additional custom script tag would be required to implement the 1 damage every time the round changes. I will have a go at writing out these routines for you when I'm a bit less hung over
|
|
|
Post by Zaphod Beeblbrox on Feb 6, 2010 12:57:12 GMT
In respect to the Archer combat this works (except no Forcefield handling):
<EVENT event="&permvar $last_round_shot;$last_round_shot=0;"></EVENT>
ARCHER 1 SKILL 7 STAMINA 5 ARCHER 2 SKILL 6 STAMINA 7 ARCHER 3 SKILL5 STAMINA 4
<SCRIPT script="&combat_multi(1,1,0,'Archer 1',7,5,'Archer 2',6,7);"></SCRIPT>
<IF condition="($combat[7] eq 'fighting') and ($last_round_shot != $combat[10]);" reval="yes" falsecolor="hidden"> <EVENT event="$last_round_shot=$combat[10];" reval="yes"></EVENT> <IF condition="&dice(1)==1;" reval="yes" falsecolor="hidden">The third Archer takes a shot at you and hits!<SCRIPT script="&damage(1);"></SCRIPT></IF> <ELSE falsecolor="hidden">The third Archer takes a shot at you and misses!</ELSE> </IF>
<IF condition="$combat[7] eq 'won';" reval="yes"> <SCRIPT script="&combat_1on1(1,2,0,'Archer 3',5,4);"></SCRIPT> <IF condition="$combat[7] eq 'won';" reval="yes"> <TT ref="2"> Now turn to 2</TT> </IF> </IF>
The code requires libraries:
FFLib FFCombat GeneralLib
... and the usual permnent variables for combat functions.
Also don't forget to modify the first two parameters of each combat call to reflect the page number/reference and fight index as usual (although I don't expect the fight indices needs changing unless you do have yet another combat on that page further up).
|
|
|
Post by Zaphod Beeblbrox on Feb 6, 2010 17:07:30 GMT
Barrel Combat: <EVENT event="&permvar $last_round_damage;$last_round_damage=0;"></EVENT>
BARREL SKILL 9 STAMINA 6
<SCRIPT script="&combat_full(2,1,$skill,'Skill',$stamina,'Stamina',1,0,2,0,2,2,0,1,0,0,'Barrel',9,6,0,0,0);"></SCRIPT>
<IF condition="($combat[7] eq 'fighting') and ($last_round_damage != $combat[10]);" reval="yes" falsecolor="hidden"> <EVENT event="$last_round_damage=$combat[10];" reval="yes"></EVENT> You suffer <INFO info="$last_round_damage+$previous_damage;"></INFO> damage from drowning <SCRIPT script="&damage($last_round_damage+$previous_damage);"></SCRIPT> </IF>
<IF condition="$combat[7] eq 'won';" reval="yes"> <TT ref="0">Testing Index</TT> </IF>
Since you want to also continue adding from whatever previous damage may have been incurred I have assumed in the other references you have defined a permanent variable called $previous_damage that contains the damage count. It's not imperative for this variable to be defined, code works fine without it for cases where the damage has not already been started. Note the use of the value '2' in the parameter 'use_luck' call to &combat_full, this prevents the option of testing luck to reduce damage taken when the Barrel 'hits' you. Again, modify page ref/id parameter and fight index parameter as necessary to your page. This code is not perfect as no damage is taken in the round of combat that you destroy the Barrel (unless you destroy the Barrel by 'lucking up' your damage, then it is applied). Given the current state of &combat_full, it would be very hard to apply the damage code-wise for that last round, due to the methods I have used in &combat_full to track combat status. But, it is of course, like anything, possible (just write your own &combat_full ).
|
|
|
Post by Zaphod Beeblbrox on Feb 6, 2010 17:23:02 GMT
I have published a book called 'test' under Hosted Books list to try those two combat codes out. Hope they do what you need.
As for the forcefield in the Archer combat - this touches on a major SEL coding aspect that I haven't really addressed yet. It is possible on a case by case basis, and with the right set of routines on a generalised basis. But the generalisation of this sort of problem is what I'm struggling with - and will probably require a complete re-write of existing routines to accomodate. It may even require extending SEL itself to allow object-orientation, which as you can appreciate is no small task. I'll try and come up with a one-off lump of ABML/SEL to address the issue on a combat by combat basis though.
|
|