As you probably know from my previous posts, I'm attempting to create a variant while knowing extremely little of the C language. This is possible mainly because of how well the Angband code is organized and commented (thanks again). All I know of the C language is from the tutorial "beej's Guide to C programming" and from looking at the Angband code. (I only read the first few sections of the tutorial thoroughly, but I kindof scanned the rest for the answer to my question and didn't find it.)
I would really like a figure out how to add a new magic realm and I've almost done it. Here's my question:
I can figure out that the following is an either/or statement, but I can't figure out how to turn it into an If/then/elseif statement.
I would guess I would do something like
Obviously, I'm not sure this is right, and even if I was, I wouldn't know how to do the text_out() part. Can someone help me with this please?
thanks in advance
I would really like a figure out how to add a new magic realm and I've almost done it. Here's my question:
I can figure out that the following is an either/or statement, but I can't figure out how to turn it into an If/then/elseif statement.
Code:
text_out(s_text + s_info[(cp_ptr->spell_book == TV_MAGIC_BOOK) ? spell : spell + PY_MAX_SPELLS].text);
Code:
IF (cp_ptr->spell_book == TV_MAGIC_BOOK) s_info = spell; ELSE IF (cp_ptr->spell_book == TV_PRAYER_BOOK) s_info = spell + PY_MAX_SPELLS; ELSE s_info = spell + (PY_MAX_SPELLS * 2);
thanks in advance
Comment