Welcome
Welcome to cosmicforge

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Fire Shield, et al.

Discussion of features of *CF* for Wizardry 6 and Wizardry 7.

Fire Shield, et al.

Postby Scary » Sun May 07, 2017 5:08 am

I've been picking up my Wizardries again and trying to understand the game mechanics a bit better. (Thank Heaven for CF!)

The description of the various shield spells in Bane and CODS has me confused, so I'm hoping someone can explain it and even give a worked example. This is for the spells Ice Shield, Fire Shield, Air Pocket, and Magic Screen, all of which appear to have the same basic mechanic.

The text from Cosmic Forge (when examining the spells in the Spell Editor) reads as follows:
Protects Target Group from [Fire/Cold/Air/Spells], overwrites the current {SHIELD STRENGTH} if the new {SHIELD STRENGTH} is greater
Reduces each of {DAMAGE ROLLS}, {DAMAGE DICE}, {DURATION ROLLS} and {DURATION DICE} the following way:
X = [{SHIELD STRENGTH} * {VALUE TO REDUCE} / 100]; X times 50% chance to reduce {VALUE TO REDUCE} by 1 (minimum result is always 1)
{SHIELD STRENGTH} is reduced by [Max(1, {SHIELD STRENGTH} / 10)] each round

The bolded language is what I do not understand.

The calculation of X, itself, I think I follow: essentially, the shield strength is applied to the {VALUE TO REDUCE} as a percentage. If it were just a straight percentage however (e.g., if a shield strength of 90 reduced a fireball by 90%) there would be no need for the bolded words, so there is probably more to it.

Providing an actual example -- say a specific level of Fire Shield protecting a party against a specific level of Fireball would be a great help to my understanding.
Scary
 
Posts: 6
Joined: Fri Jan 02, 2015 5:12 am

Re: Fire Shield, et al.

Postby madgod » Thu May 11, 2017 4:05 am

Good question!
Sorry for that vague explanation - I tried my best!

Basically, X times 50% chance to do something, means we roll 100 dice X times and each roll, if it is within [1, 50] interval, then we do something, if it is in [51, 100] interval, then we do nothing for this roll.
You can consider it as flipping a coin, since it is 50% chance. But I prefer operating with "100 dice". :)

As the algorithm goes:
Code: Select all
X = shieldStrength * valueToReduce / 100;
for i = 0; i < X; i++
{
  if rand(100) < 50 // Note, that rand returns value in range [0, 100)
  {
    valueToReduce--;
  }
}
valueToReduce = max(1, valueToReduce);


The rest you understand, I get it. :)

P.S. Good to hear some people are still interested in Wizardries and play with CF.
madgod
Site Admin
 
Posts: 286
Joined: Sun Feb 12, 2012 2:12 am

Re: Fire Shield, et al.

Postby Scary » Fri May 12, 2017 5:02 pm

So let me see if I can work through an example:

My very-fast fairy mage casts fire shield on the first round of combat at power level 6. Shield Strength (SS) = 6*15 = 90.

Later that same round, a Pharaoh of Phyre casts a power level 3 fireball at us. Fireball has no {DURATION ROLLS} or {DURATION DICE}, so the only {VALUE TO REDUCE} is {DAMAGE ROLLS} and {DAMAGE DICE}. I assume you would have to start with {DAMAGE DICE} first, since if they are reduced, that will affect the {DAMAGE ROLLS}.

A power-level 3 fireball does 2d5*power, so that would be 2*3 = 6d5, and 6 is our {VALUE TO REDUCE}.

We plug that into the formula: X = 90*6/100 = 5.4. Reading code is not my strong suit :oops: but I think what you've written means that we roll a percentile die (1d100) six times in this case (for I = 0, 1, 2, 3, 4, and 5). Each time the result is low (<51), we subtract 1 from the {VALUE TO REDUCE}. So, if the rolls were (99, 1, 5, 87, 51, 72), we would reduce the {DAMAGE DICE} by 2: instead of rolling 6d5, it would only roll 4d5.

Then it does this process again for the next {VALUE TO REDUCE} -- {DAMAGE ROLLS}. Assume the damage roll was exactly average, so a 10 was rolled: X = 90*10/100 = 9. We roll a percentile die ten more times, and each time the result is less than 51, we subtract 1 from the damage roll. If we rolled low 3 times, actual damage would be 9-3 = 6.

Is that how it goes? (It does seem a little strange that it would go through this process twice -- once for {DAMAGE DICE} and once for {DAMAGE ROLLS}, but the designers seem to have enjoyed such complication.
Scary
 
Posts: 6
Joined: Fri Jan 02, 2015 5:12 am

Re: Fire Shield, et al.

Postby madgod » Sat May 13, 2017 5:07 am

Almost there. :)

Once again I spent so much time devising the terminology, but failed. :)

Let's clarify some CF's terminology first.
When we roll d8 five times we write 5d8. Here 5 is {ROLLS} and 8 is {DICE}. Surprise!
So yes, {ROLLS} is not the result of the 5d8, it is how many times you have to roll the dice!
So in you Fireball example (6d5) you apply the algorithm separately to 6 and 5 and end up with a new pair, say 4d3 or 4d2 or 3d4, instead. Minimum would be 1d1 when you are crazy lucky.

Now, for your X = 90*6/100 = 5.4 you would round 5.4 down to 5, so you will roll 1d100 five times.

Otherwise everything is correct.
madgod
Site Admin
 
Posts: 286
Joined: Sun Feb 12, 2012 2:12 am

Re: Fire Shield, et al.

Postby Scary » Sat May 13, 2017 6:08 pm

Thank You!

Now, I believe my understanding of it is complete. Again, thanks for taking the time. :D

Edit: As I'm finalizing my notes, I realize I have one more clarification: fire shield, ice shield, and air pocket are specific to their particular categories of effects (fire, cold, and air, respectively), but magic screen applies its effect to all spells, so if I have both magic screen and fire shield up when hit by a fire ball, does the game apply both effects, first reducing it with magic screen and then reducing those already-reduced values by fire shield?

(Example: hit with a 6d5 fireball, magic screen reduces it to 4d4, then fire shield reduces it to 3d2?)
Scary
 
Posts: 6
Joined: Fri Jan 02, 2015 5:12 am

Re: Fire Shield, et al.

Postby madgod » Sun May 14, 2017 5:00 am

Just looked at the disassembly.
First the elemental shield reduces the spell if resistance matches, then magic screen has a go at it.
madgod
Site Admin
 
Posts: 286
Joined: Sun Feb 12, 2012 2:12 am

Re: Fire Shield, et al.

Postby Scary » Sun May 14, 2017 11:55 pm

Thanks again, MadGod.

May I ask what you used to disassemble the code? I've been going back to one of my old questions and wondering if I could figure out how to make a change: I want to switch the "Tunes of Music" ability from the Bard to a different class in Bane. I understand your previous comment about the impracticality-bordering-on-impossibility of doing a patch that opens up the ability to other classes. I'm hoping that it's much simpler if I'm just changing what class code the engine looks for when you try to play an instrument. As it's not something likely to be of interest to anyone but myself, I'm trying to learn how I might go about doing it. :geek:
Scary
 
Posts: 6
Joined: Fri Jan 02, 2015 5:12 am

Re: Fire Shield, et al.

Postby madgod » Mon May 15, 2017 5:16 am

I was using IDA - the interactive disassembler.

As for doing it yourself - you have probably to learn something about it and have a lot of time. :)
madgod
Site Admin
 
Posts: 286
Joined: Sun Feb 12, 2012 2:12 am


Return to *CF* for W6/W7

Who is online

Users browsing this forum: No registered users and 1 guest

cron
suspicion-preferred