|
|
@ -101,6 +101,7 @@ void CModifiersInDB::writeInDatabase(CCDBSynchronised &database)
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setSHEET(database, Bonus[i].SheetId);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setSHEET(database, Bonus[i].SheetId);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[i], 1);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[i], 1);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED(database, true);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED(database, true);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED_TIME(database, Bonus[i].ActivationDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (uint i = 0 ; i < NbMalusModifiers ; ++i)
|
|
|
|
for (uint i = 0 ; i < NbMalusModifiers ; ++i)
|
|
|
@ -111,6 +112,7 @@ void CModifiersInDB::writeInDatabase(CCDBSynchronised &database)
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setSHEET(database, Malus[i].SheetId);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setSHEET(database, Malus[i].SheetId);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[i], 1);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[i], 1);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED(database, true);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED(database, true);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED_TIME(database, Malus[i].ActivationDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -126,6 +128,7 @@ void CModifiersInDB::update(CCDBSynchronised &database)
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setSHEET(database, CSheetId::Unknown);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setSHEET(database, CSheetId::Unknown);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[i], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[i], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(i).setDISABLED_TIME(database, 0);
|
|
|
|
Bonus[i].init();
|
|
|
|
Bonus[i].init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -137,12 +140,13 @@ void CModifiersInDB::update(CCDBSynchronised &database)
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setSHEET(database, CSheetId::Unknown);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setSHEET(database, CSheetId::Unknown);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[i], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[i], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(i).setDISABLED_TIME(database, 0);
|
|
|
|
Malus[i].init();
|
|
|
|
Malus[i].init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sint8 CModifiersInDB::addEffect(const NLMISC::CSheetId &sheetId, bool bonus, CCDBSynchronised &database)
|
|
|
|
sint8 CModifiersInDB::addEffect(const NLMISC::CSheetId &sheetId, bool bonus, NLMISC::TGameCycle endTime, CCDBSynchronised &database)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (sheetId == NLMISC::CSheetId::Unknown)
|
|
|
|
if (sheetId == NLMISC::CSheetId::Unknown)
|
|
|
|
return (sint8)-1;
|
|
|
|
return (sint8)-1;
|
|
|
@ -167,12 +171,14 @@ sint8 CModifiersInDB::addEffect(const NLMISC::CSheetId &sheetId, bool bonus, CCD
|
|
|
|
if (freeSlot != -1)
|
|
|
|
if (freeSlot != -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
modifiers[freeSlot].SheetId = sheetId;
|
|
|
|
modifiers[freeSlot].SheetId = sheetId;
|
|
|
|
|
|
|
|
modifiers[freeSlot].ActivationDate = endTime;
|
|
|
|
if(bonus)
|
|
|
|
if(bonus)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Sheet[freeSlot], sheetId.asInt() );
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Sheet[freeSlot], sheetId.asInt() );
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(freeSlot).setSHEET(database, sheetId );
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(freeSlot).setSHEET(database, sheetId );
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[freeSlot], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[freeSlot], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(freeSlot).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(freeSlot).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(freeSlot).setDISABLED_TIME(database, endTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -180,6 +186,7 @@ sint8 CModifiersInDB::addEffect(const NLMISC::CSheetId &sheetId, bool bonus, CCD
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(freeSlot).setSHEET(database, sheetId );
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(freeSlot).setSHEET(database, sheetId );
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[freeSlot], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[freeSlot], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(freeSlot).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(freeSlot).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(freeSlot).setDISABLED_TIME(database, endTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -200,6 +207,7 @@ void CModifiersInDB::removeEffect(uint8 index, bool bonus, CCDBSynchronised &dat
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setSHEET(database, CSheetId::Unknown );
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setSHEET(database, CSheetId::Unknown );
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[index], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Bonus.Disable[index], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setDISABLED_TIME(database, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -207,16 +215,16 @@ void CModifiersInDB::removeEffect(uint8 index, bool bonus, CCDBSynchronised &dat
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setSHEET(database, CSheetId::Unknown);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setSHEET(database, CSheetId::Unknown);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[index], 0);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.Disable[index], 0);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED(database, false);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED(database, false);
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED_TIME(database, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CModifiersInDB::disableEffect(uint8 index, bool bonus, NLMISC::TGameCycle activationDate, CCDBSynchronised &database)
|
|
|
|
void CModifiersInDB::disableEffect(uint8 index, bool bonus, const NLMISC::CSheetId &sheetId, NLMISC::TGameCycle activationDate, CCDBSynchronised &database)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( (bonus && index >= NbBonusModifiers) || (!bonus && index >= NbMalusModifiers) )
|
|
|
|
if ( (bonus && index >= NbBonusModifiers) || (!bonus && index >= NbMalusModifiers) )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<CModifierInDB> &modifiers = bonus ? Bonus : Malus;
|
|
|
|
std::vector<CModifierInDB> &modifiers = bonus ? Bonus : Malus;
|
|
|
|
const std::string type = bonus ? "BONUS:" : "MALUS:";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modifiers[index].Disabled = true;
|
|
|
|
modifiers[index].Disabled = true;
|
|
|
|
modifiers[index].ActivationDate = activationDate;
|
|
|
|
modifiers[index].ActivationDate = activationDate;
|
|
|
@ -235,6 +243,31 @@ void CModifiersInDB::disableEffect(uint8 index, bool bonus, NLMISC::TGameCycle a
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.DisableTime[index], activationDate);
|
|
|
|
// database.setProp( CCharacter::getDataIndexReminder()->Modifiers.Malus.DisableTime[index], activationDate);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED_TIME(database, activationDate);
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED_TIME(database, activationDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// update sheetId only when needed
|
|
|
|
|
|
|
|
if (modifiers[index].SheetId == CSheetId::Unknown)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
modifiers[index].SheetId = sheetId;
|
|
|
|
|
|
|
|
if (bonus)
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setSHEET(database, sheetId);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setSHEET(database, sheetId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CModifiersInDB::updateEffect(uint8 index, bool bonus, NLMISC::TGameCycle activationDate, CCDBSynchronised &database)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( (bonus && index >= NbBonusModifiers) || (!bonus && index >= NbMalusModifiers) )
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<CModifierInDB> &modifiers = bonus ? Bonus : Malus;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modifiers[index].ActivationDate = activationDate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(bonus)
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getBONUS().getArray(index).setDISABLED_TIME(database, activationDate);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
CBankAccessor_PLR::getMODIFIERS().getMALUS().getArray(index).setDISABLED_TIME(database, activationDate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CModifiersInDB::_addBonus(const CModifierInDB& bonus)
|
|
|
|
void CModifiersInDB::_addBonus(const CModifierInDB& bonus)
|
|
|
|