Diff
checker
Text
Text
Bilder
Dokumente
Excel
Ordner
Legal
Enterprise
Desktop-App
Preise
Einloggen
Diffchecker Desktop herunterladen
Texte vergleichen
Finde den Unterschied zwischen zwei Textdateien
Werkzeuge
Verlauf
Live-Editor
Gleiches ausblenden
Zeilenumbruch aus
Ansicht
Zweispaltig
Einspaltig
Vergleichsgenauigkeit
Intelligent
Wort
Zeichen
Syntaxhervorhebung
Syntax auswählen
Ignorieren
Text umwandeln
Zur ersten Änderung
Eingabe bearbeiten
Diffchecker Desktop
Der sicherste Weg, Diffchecker zu nutzen. Hol dir die Desktop-App: Deine Diffs verlassen nie deinen Computer!
Desktop holen
Untitled diff
Erstellt
vor 9 Jahren
Diff läuft nie ab
Löschen
Exportieren
Teilen
Erklären
0 Entfernungen
Zeilen
Gesamt
Entfernt
Zeichen
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
75 Zeilen
Kopieren
7 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Zeichen
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
82 Zeilen
Kopieren
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());
Kopieren
Kopiert
Kopieren
Kopiert
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();
}
}
Gespeicherte Diffs
Originaltext
Datei öffnen
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(); }
Bearbeitung
Datei öffnen
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(); }
Unterschied finden