Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CHARACTER::BuffOnAttr_ValueChange(BYTE bType, BYTE bOldValue, BYTE bNewValue)
- {
- TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.find(bType);
- if (0 == bNewValue)
- {
- if (m_map_buff_on_attrs.end() == it)
- return;
- else
- it->second->Off();
- }
- else if(0 == bOldValue)
- {
- CBuffOnAttributes* pBuff;
- if (m_map_buff_on_attrs.end() == it)
- {
- switch (bType)
- {
- case POINT_ENERGY:
- {
- static BYTE abSlot[] = { WEAR_BODY, WEAR_HEAD, WEAR_FOOTS, WEAR_WRIST, WEAR_WEAPON, WEAR_NECK, WEAR_EAR, WEAR_SHIELD };
- static std::vector <BYTE> vec_slots (abSlot, abSlot + _countof(abSlot));
- pBuff = M2_NEW CBuffOnAttributes(this, bType, &vec_slots);
- }
- break;
- case POINT_COSTUME_ATTR_BONUS:
- {
- static BYTE abSlot[] = { WEAR_COSTUME_BODY, WEAR_COSTUME_HAIR };
- static std::vector <BYTE> vec_slots (abSlot, abSlot + _countof(abSlot));
- pBuff = M2_NEW CBuffOnAttributes(this, bType, &vec_slots);
- }
- break;
- default:
- break;
- }
- m_map_buff_on_attrs.insert(TMapBuffOnAttrs::value_type(bType, pBuff));
- }
- else
- pBuff = it->second;
- pBuff->On(bNewValue);
- }
- else
- {
- if (m_map_buff_on_attrs.end() == it)
- return;
- else
- it->second->ChangeBuffValue(bNewValue);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement