Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 9 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
0 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
75 lignes
Copier tout
7 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
82 lignes
Copier tout
void Player::removeExperience(uint64_t exp, bool sendText/* = false*/)
void Player::removeExperience(uint64_t exp, bool sendText/* = false*/)
{
{
if (experience == 0 || exp == 0) {
if (experience == 0 || exp == 0) {
return;
return;
}
}
g_events->eventPlayerOnLoseExperience(this, exp);
g_events->eventPlayerOnLoseExperience(this, exp);
if (exp == 0) {
if (exp == 0) {
return;
return;
}
}
uint64_t lostExp = experience;
uint64_t lostExp = experience;
experience = std::max<int64_t>(0, experience - exp);
experience = std::max<int64_t>(0, experience - exp);
if (sendText) {
if (sendText) {
lostExp -= experience;
lostExp -= experience;
std::string expString = std::to_string(lostExp) + (lostExp != 1 ? " experience points." : " experience point.");
std::string expString = std::to_string(lostExp) + (lostExp != 1 ? " experience points." : " experience point.");
TextMessage message(MESSAGE_EXPERIENCE, "You lost " + expString);
TextMessage message(MESSAGE_EXPERIENCE, "You lost " + expString);
message.position = position;
message.position = position;
message.primary.value = lostExp;
message.primary.value = lostExp;
message.primary.color = TEXTCOLOR_RED;
message.primary.color = TEXTCOLOR_RED;
sendTextMessage(message);
sendTextMessage(message);
SpectatorHashSet spectators;
SpectatorHashSet spectators;
g_game.map.getSpectators(spectators, position, false, true);
g_game.map.getSpectators(spectators, position, false, true);
spectators.erase(this);
spectators.erase(this);
if (!spectators.empty()) {
if (!spectators.empty()) {
message.type = MESSAGE_EXPERIENCE_OTHERS;
message.type = MESSAGE_EXPERIENCE_OTHERS;
message.text = getName() + " lost " + expString;
message.text = getName() + " lost " + expString;
for (Creature* spectator : spectators) {
for (Creature* spectator : spectators) {
spectator->getPlayer()->sendTextMessage(message);
spectator->getPlayer()->sendTextMessage(message);
}
}
}
}
}
}
uint32_t oldLevel = level;
uint32_t oldLevel = level;
uint64_t currLevelExp = Player::getExpForLevel(level);
uint64_t currLevelExp = Player::getExpForLevel(level);
while (level > 1 && experience < currLevelExp) {
while (level > 1 && experience < currLevelExp) {
--level;
--level;
healthMax = std::max<int32_t>(0, healthMax - vocation->getHPGain());
healthMax = std::max<int32_t>(0, healthMax - vocation->getHPGain());
manaMax = std::max<int32_t>(0, manaMax - vocation->getManaGain());
manaMax = std::max<int32_t>(0, manaMax - vocation->getManaGain());
capacity = std::max<int32_t>(0, capacity - vocation->getCapGain());
capacity = std::max<int32_t>(0, capacity - vocation->getCapGain());
currLevelExp = Player::getExpForLevel(level);
currLevelExp = Player::getExpForLevel(level);
}
}
if (oldLevel != level) {
if (oldLevel != level) {
health = healthMax;
health = healthMax;
mana = manaMax;
mana = manaMax;
updateBaseSpeed();
updateBaseSpeed();
setBaseSpeed(getBaseSpeed());
setBaseSpeed(getBaseSpeed());
g_game.changeSpeed(this, 0);
g_game.changeSpeed(this, 0);
g_game.addCreatureHealth(this);
g_game.addCreatureHealth(this);
if (party) {
if (party) {
party->updateSharedExperience();
party->updateSharedExperience();
}
}
std::ostringstream ss;
std::ostringstream ss;
ss << "You were downgraded from Level " << oldLevel << " to Level " << level << '.';
ss << "You were downgraded from Level " << oldLevel << " to Level " << level << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
Copier
Copié
Copier
Copié
if (passiveDamageBonus > 0)
{
passiveDamageBonus--;
std::ostringstream msgPassive;
msgPassive << "Your passive damage bonus has reduced from " << passiveDamageBonus + 1 << "% to " << passiveDamageBonus << "%.";
sendTextMessage(MESSAGE_EVENT_ADVANCE, msgPassive.str());
}
}
}
uint64_t nextLevelExp = Player::getExpForLevel(level + 1);
uint64_t nextLevelExp = Player::getExpForLevel(level + 1);
if (nextLevelExp > currLevelExp) {
if (nextLevelExp > currLevelExp) {
levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp);
levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp);
} else {
} else {
levelPercent = 0;
levelPercent = 0;
}
}
sendStats();
sendStats();
}
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
void Player::removeExperience(uint64_t exp, bool sendText/* = false*/) { if (experience == 0 || exp == 0) { return; } g_events->eventPlayerOnLoseExperience(this, exp); if (exp == 0) { return; } uint64_t lostExp = experience; experience = std::max<int64_t>(0, experience - exp); if (sendText) { lostExp -= experience; std::string expString = std::to_string(lostExp) + (lostExp != 1 ? " experience points." : " experience point."); TextMessage message(MESSAGE_EXPERIENCE, "You lost " + expString); message.position = position; message.primary.value = lostExp; message.primary.color = TEXTCOLOR_RED; sendTextMessage(message); SpectatorHashSet spectators; g_game.map.getSpectators(spectators, position, false, true); spectators.erase(this); if (!spectators.empty()) { message.type = MESSAGE_EXPERIENCE_OTHERS; message.text = getName() + " lost " + expString; for (Creature* spectator : spectators) { spectator->getPlayer()->sendTextMessage(message); } } } uint32_t oldLevel = level; uint64_t currLevelExp = Player::getExpForLevel(level); while (level > 1 && experience < currLevelExp) { --level; healthMax = std::max<int32_t>(0, healthMax - vocation->getHPGain()); manaMax = std::max<int32_t>(0, manaMax - vocation->getManaGain()); capacity = std::max<int32_t>(0, capacity - vocation->getCapGain()); currLevelExp = Player::getExpForLevel(level); } if (oldLevel != level) { health = healthMax; mana = manaMax; updateBaseSpeed(); setBaseSpeed(getBaseSpeed()); g_game.changeSpeed(this, 0); g_game.addCreatureHealth(this); if (party) { party->updateSharedExperience(); } std::ostringstream ss; ss << "You were downgraded from Level " << oldLevel << " to Level " << level << '.'; sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str()); } uint64_t nextLevelExp = Player::getExpForLevel(level + 1); if (nextLevelExp > currLevelExp) { levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp); } else { levelPercent = 0; } sendStats(); }
Texte modifié
Ouvrir un fichier
void Player::removeExperience(uint64_t exp, bool sendText/* = false*/) { if (experience == 0 || exp == 0) { return; } g_events->eventPlayerOnLoseExperience(this, exp); if (exp == 0) { return; } uint64_t lostExp = experience; experience = std::max<int64_t>(0, experience - exp); if (sendText) { lostExp -= experience; std::string expString = std::to_string(lostExp) + (lostExp != 1 ? " experience points." : " experience point."); TextMessage message(MESSAGE_EXPERIENCE, "You lost " + expString); message.position = position; message.primary.value = lostExp; message.primary.color = TEXTCOLOR_RED; sendTextMessage(message); SpectatorHashSet spectators; g_game.map.getSpectators(spectators, position, false, true); spectators.erase(this); if (!spectators.empty()) { message.type = MESSAGE_EXPERIENCE_OTHERS; message.text = getName() + " lost " + expString; for (Creature* spectator : spectators) { spectator->getPlayer()->sendTextMessage(message); } } } uint32_t oldLevel = level; uint64_t currLevelExp = Player::getExpForLevel(level); while (level > 1 && experience < currLevelExp) { --level; healthMax = std::max<int32_t>(0, healthMax - vocation->getHPGain()); manaMax = std::max<int32_t>(0, manaMax - vocation->getManaGain()); capacity = std::max<int32_t>(0, capacity - vocation->getCapGain()); currLevelExp = Player::getExpForLevel(level); } if (oldLevel != level) { health = healthMax; mana = manaMax; updateBaseSpeed(); setBaseSpeed(getBaseSpeed()); g_game.changeSpeed(this, 0); g_game.addCreatureHealth(this); if (party) { party->updateSharedExperience(); } std::ostringstream ss; ss << "You were downgraded from Level " << oldLevel << " to Level " << level << '.'; sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str()); if (passiveDamageBonus > 0) { passiveDamageBonus--; std::ostringstream msgPassive; msgPassive << "Your passive damage bonus has reduced from " << passiveDamageBonus + 1 << "% to " << passiveDamageBonus << "%."; sendTextMessage(MESSAGE_EVENT_ADVANCE, msgPassive.str()); } } uint64_t nextLevelExp = Player::getExpForLevel(level + 1); if (nextLevelExp > currLevelExp) { levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp); } else { levelPercent = 0; } sendStats(); }
Trouver la différence