View Full Version : 1 question (well... 2 to be exact)

Yoshi

01-01-2003, 01:40 PM

how do you calculate HP from constitution?

how do you calculate mana from intelligence?

show me your way(s).

i'm doing an RPG.

one more:

how do I find out how many lines are there with ifstream?

how you calculate hp and mana is up to your own imagination.

some games have stats directly equal to attributes. such as 50 intelligence gives 50 mana.

others do formulas to decide stats. like, say, mana = 1.5 x int, so 50 int gives 75 mana.

others keep them entirely seperate. for example, a character can get mana + ( int / 2 ) mana per level, and intelligence only gives percent chance to cast spells or something, so if a character starts with a D&D 14 intelligence, they get 7 extra mana per level and have, say 80% chance to cast spells of their own level, and a higher % for every level lower.

its entirely up to you how you want your game to be played, and whether attributes will increase over time like most MMORPGs or stay the same, like D&D.

compjinx

01-01-2003, 03:18 PM

how do I find out how many lines are there with ifstream?

Is this a serious question? Just wondering. If it is then you simply scane the whole file and count the number of newline characters. Since a newline character is the same as any other character it is the same as finding the number of accurances of any character. Simply go through the whole thing and count the number of newline characters.

Of course someone will come along and show how inefficient this is and devise a replacement.

Powered by vBulletin® Version 4.2.5 Copyright © 2019 vBulletin Solutions Inc. All rights reserved.