- Joined
- Jan 5, 2009
- Messages
- 1,127
I am making an Text Based RPG using C++.
I was just checking if this is possible?
So I have a class right.
ok.
So I set a mob called a wraith
Ok so thats like a preset type I should say.
So if I do:
Will that work?
~Thanks Crazed_seal
I was just checking if this is possible?
So I have a class right.
Code:
class Monster
{
public:
int m_damageMin, m_damageMax, m_attacks, m_health, m_defense, m_expGive;
string m_name, m_discription, m_target;
bool IsAlive()
{
if (m_health > 0)
{
return true;
}
else
{
return false;
}
};
bool IsAttacking()
{
if (m_target == "")
{
return false;
}
else
{
return true;
}
};
};
So I set a mob called a wraith
Code:
Monster WraithMob()
{
Monster Wraith;
Wraith.m_damageMin = 8;
Wraith.m_damageMax = 12;
Wraith.m_attacks = 1;
Wraith.m_health = 10;
Wraith.m_defense = 80;
Wraith.m_expGive = 55;
Wraith.m_name = "Wraith";
Wraith.m_discription = "A Wraith is hard to hit, it only has 10 health. \nIf you manage to hit you'll most likely kill it";
return Wraith;
}
So if I do:
Code:
Monster AttackingMonster;
AttackingMonster = WraithMob();
~Thanks Crazed_seal
NO STEALING MAH CODE