Public Group

#### Archived

This topic is now archived and is closed to further replies.

# Implementing Weaknesses

This topic is 5442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a general idea of how it''s going to work. I have 6 elements: Wind, Water, Fire, Earth, Life, Death and each item has it''s own weakness properties, but how would I beable to create a field to show weakness to other weaknesses? What would be the best way to implement this?

##### Share on other sites
I may have misunderstood, but your question doesn''t seem to makes sense. How can you have a weakness to a weakness? Please explain more specifically what you need .

##### Share on other sites
Err I guess a weakness to a strength ...

Like if player 1''s properties for an item is 70% life -50% death
and the monsters property is -75% Life, and 100% death. If you were attacking with a life element your attack would be ((70+100)-(-75+100))% or 145% dmg. so reasonably saying if you were attacking with death, you''d heal the monster because you''re atk is in the negotives.

Something along those lines.

##### Share on other sites
A field to show it? A table would be the simplest, albeit not very visually appealing. Or, if there was a 1-to-1 correlation between each element and its weak element, maybe a cycle.

If you''re doing the 1-to-1 correlation, I don''t see how you''re going to make the 6 elements link together; wind, water, fire, and earth are the ''classic'' four elements, but how do life and death fit into those?

##### Share on other sites
They don't neccessrly fit into the categories of elements, but it just add's something a bit different and not usually done.

This is what I have so far.
struct ElementProperties{	int eWind;	int eFire;	int eWater;	int eEarth;	int eLife;	int eDeath;	int operator[](int m_number)	{		switch(m_number)		{			case 1: return eWind; break;			case 2: return eFire; break;			case 3: return eWater; break;			case 4: return eEarth; break;			case 5: return eLife; break;			case 6: return eDeath; break;			default: return 0;		}	}	ElementProperties* Weakness(ElementProperties& rhs)	{		ElementProperties* EleWeak;		EleWeak = new ElementProperties;		EleWeak->eWind	= (eWind - rhs.eWind);		EleWeak->eFire		= (eFire - rhs.eFire);		EleWeak->eWater	= (eWater - rhs.eWater);		EleWeak->eEarth	= (eEarth - rhs.eEarth);		EleWeak->eLife		= (eLife - rhs.eLife);		EleWeak->eDeath	= (eDeath - rhs.eDeath);        return EleWeak;	}};

Is this a good approach to calculate element weaknesses? (Assuming each element \100 will give a atk\def modifier)

[edited by - PumpkinPieman on November 29, 2003 12:06:41 PM]

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632997
• Total Posts
3009790
• ### Who's Online (See full list)

There are no registered users currently online

×