void ConditionSpeed::addCondition(Creature* creature, const Condition* addCondition) { if(conditionType != addCondition->getType() || (ticks == -1 && addCondition->getTicks() > 0)) return; setTicks(addCondition->getTicks()); const ConditionSpeed& conditionSpeed = static_cast<const ConditionSpeed&>(*addCondition); int32_t oldSpeedDelta = speedDelta; mina = conditionSpeed.mina; maxa = conditionSpeed.maxa; minb = conditionSpeed.minb; maxb = conditionSpeed.maxb; speedDelta = conditionSpeed.speedDelta; outfits = conditionSpeed.outfits; changeOutfit(creature); if(!speedDelta) { int32_t min, max; getFormulaValues(creature->getBaseSpeed(), min, max); speedDelta = random_range(min, max); } int32_t newSpeedChange = speedDelta - oldSpeedDelta; if(newSpeedChange) g_game.changeSpeed(creature, newSpeedChange); }
bool ConditionOutfit::startCondition(Creature* creature) { if(!Condition::startCondition(creature)) return false; changeOutfit(creature); return true; }
void ConditionOutfit::addCondition(Creature* creature, const Condition* addCondition) { if (updateCondition(addCondition)) { setTicks(addCondition->getTicks()); const ConditionOutfit& conditionOutfit = static_cast<const ConditionOutfit&>(*addCondition); outfits = conditionOutfit.outfits; changeOutfit(creature); } }
bool ConditionOutfit::startCondition(Creature* creature) { changeOutfit(creature); return Condition::startCondition(creature); }