Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
9 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
0 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
75 行
すべてコピー
7 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
82 行
すべてコピー
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());
コピー
コピー済み
コピー
コピー済み
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();
}
}
保存された差分
原文
ファイルを開く
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(); }
変更されたテキスト
ファイルを開く
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(); }
違いを見つける