Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
9년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
0 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
52 행
복사
10 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
62 행
복사
CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const
CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const
{
{
CombatDamage damage;
CombatDamage damage;
damage.origin = params.origin;
damage.origin = params.origin;
damage.primary.type = params.combatType;
damage.primary.type = params.combatType;
if (formulaType == COMBAT_FORMULA_DAMAGE) {
if (formulaType == COMBAT_FORMULA_DAMAGE) {
damage.primary.value = normal_random(
damage.primary.value = normal_random(
static_cast<int32_t>(mina),
static_cast<int32_t>(mina),
static_cast<int32_t>(maxa)
static_cast<int32_t>(maxa)
);
);
} else if (creature) {
} else if (creature) {
int32_t min, max;
int32_t min, max;
if (creature->getCombatValues(min, max)) {
if (creature->getCombatValues(min, max)) {
damage.primary.value = normal_random(min, max);
damage.primary.value = normal_random(min, max);
} else if (Player* player = creature->getPlayer()) {
} else if (Player* player = creature->getPlayer()) {
if (params.valueCallback) {
if (params.valueCallback) {
params.valueCallback->getMinMaxValues(player, damage, params.useCharges);
params.valueCallback->getMinMaxValues(player, damage, params.useCharges);
} else if (formulaType == COMBAT_FORMULA_LEVELMAGIC) {
} else if (formulaType == COMBAT_FORMULA_LEVELMAGIC) {
int32_t levelFormula = player->getLevel() * 2 + player->getMagicLevel() * 3;
int32_t levelFormula = player->getLevel() * 2 + player->getMagicLevel() * 3;
damage.primary.value = normal_random(
damage.primary.value = normal_random(
static_cast<int32_t>(levelFormula * mina + minb),
static_cast<int32_t>(levelFormula * mina + minb),
static_cast<int32_t>(levelFormula * maxa + maxb)
static_cast<int32_t>(levelFormula * maxa + maxb)
);
);
} else if (formulaType == COMBAT_FORMULA_SKILL) {
} else if (formulaType == COMBAT_FORMULA_SKILL) {
Item* tool = player->getWeapon();
Item* tool = player->getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);
const Weapon* weapon = g_weapons->getWeapon(tool);
if (weapon) {
if (weapon) {
damage.primary.value = normal_random(
damage.primary.value = normal_random(
static_cast<int32_t>(minb),
static_cast<int32_t>(minb),
static_cast<int32_t>(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb)
static_cast<int32_t>(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb)
);
);
damage.secondary.type = weapon->getElementType();
damage.secondary.type = weapon->getElementType();
damage.secondary.value = weapon->getElementDamage(player, target, tool);
damage.secondary.value = weapon->getElementDamage(player, target, tool);
if (params.useCharges) {
if (params.useCharges) {
uint16_t charges = tool->getCharges();
uint16_t charges = tool->getCharges();
if (charges != 0) {
if (charges != 0) {
g_game.transformItem(tool, tool->getID(), charges - 1);
g_game.transformItem(tool, tool->getID(), charges - 1);
}
}
}
}
} else {
} else {
damage.primary.value = normal_random(
damage.primary.value = normal_random(
static_cast<int32_t>(minb),
static_cast<int32_t>(minb),
static_cast<int32_t>(maxb)
static_cast<int32_t>(maxb)
);
);
}
}
}
}
}
}
}
}
복사
복사됨
복사
복사됨
//custom edit: passive damage bonus // ONLY DAMAGE, NOT INCREASE HEALING
if (creature->getPlayer()) // caster is player
{
if (params.combatType != COMBAT_HEALING)
{
damage.primary.value += ((damage.primary.value / 100)*creature->getPlayer()->getPassiveDamageBonus());
damage.secondary.value += ((damage.secondary.value / 100)*creature->getPlayer()->getPassiveDamageBonus());
}
}
return damage;
return damage;
}
}
저장된 비교 결과
원본
파일 열기
CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const { CombatDamage damage; damage.origin = params.origin; damage.primary.type = params.combatType; if (formulaType == COMBAT_FORMULA_DAMAGE) { damage.primary.value = normal_random( static_cast<int32_t>(mina), static_cast<int32_t>(maxa) ); } else if (creature) { int32_t min, max; if (creature->getCombatValues(min, max)) { damage.primary.value = normal_random(min, max); } else if (Player* player = creature->getPlayer()) { if (params.valueCallback) { params.valueCallback->getMinMaxValues(player, damage, params.useCharges); } else if (formulaType == COMBAT_FORMULA_LEVELMAGIC) { int32_t levelFormula = player->getLevel() * 2 + player->getMagicLevel() * 3; damage.primary.value = normal_random( static_cast<int32_t>(levelFormula * mina + minb), static_cast<int32_t>(levelFormula * maxa + maxb) ); } else if (formulaType == COMBAT_FORMULA_SKILL) { Item* tool = player->getWeapon(); const Weapon* weapon = g_weapons->getWeapon(tool); if (weapon) { damage.primary.value = normal_random( static_cast<int32_t>(minb), static_cast<int32_t>(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb) ); damage.secondary.type = weapon->getElementType(); damage.secondary.value = weapon->getElementDamage(player, target, tool); if (params.useCharges) { uint16_t charges = tool->getCharges(); if (charges != 0) { g_game.transformItem(tool, tool->getID(), charges - 1); } } } else { damage.primary.value = normal_random( static_cast<int32_t>(minb), static_cast<int32_t>(maxb) ); } } } } return damage; }
수정본
파일 열기
CombatDamage Combat::getCombatDamage(Creature* creature, Creature* target) const { CombatDamage damage; damage.origin = params.origin; damage.primary.type = params.combatType; if (formulaType == COMBAT_FORMULA_DAMAGE) { damage.primary.value = normal_random( static_cast<int32_t>(mina), static_cast<int32_t>(maxa) ); } else if (creature) { int32_t min, max; if (creature->getCombatValues(min, max)) { damage.primary.value = normal_random(min, max); } else if (Player* player = creature->getPlayer()) { if (params.valueCallback) { params.valueCallback->getMinMaxValues(player, damage, params.useCharges); } else if (formulaType == COMBAT_FORMULA_LEVELMAGIC) { int32_t levelFormula = player->getLevel() * 2 + player->getMagicLevel() * 3; damage.primary.value = normal_random( static_cast<int32_t>(levelFormula * mina + minb), static_cast<int32_t>(levelFormula * maxa + maxb) ); } else if (formulaType == COMBAT_FORMULA_SKILL) { Item* tool = player->getWeapon(); const Weapon* weapon = g_weapons->getWeapon(tool); if (weapon) { damage.primary.value = normal_random( static_cast<int32_t>(minb), static_cast<int32_t>(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb) ); damage.secondary.type = weapon->getElementType(); damage.secondary.value = weapon->getElementDamage(player, target, tool); if (params.useCharges) { uint16_t charges = tool->getCharges(); if (charges != 0) { g_game.transformItem(tool, tool->getID(), charges - 1); } } } else { damage.primary.value = normal_random( static_cast<int32_t>(minb), static_cast<int32_t>(maxb) ); } } } } //custom edit: passive damage bonus // ONLY DAMAGE, NOT INCREASE HEALING if (creature->getPlayer()) // caster is player { if (params.combatType != COMBAT_HEALING) { damage.primary.value += ((damage.primary.value / 100)*creature->getPlayer()->getPassiveDamageBonus()); damage.secondary.value += ((damage.secondary.value / 100)*creature->getPlayer()->getPassiveDamageBonus()); } } return damage; }
비교하기