📄 alignmentmanager.cpp
字号:
//////////////////////////////////////////////////////////////////////////////// Filename : AlignmentManager.cpp// Written By :// Description : //////////////////////////////////////////////////////////////////////////////#include "AlignmentManager.h"#include "Assert.h"#include "DB.h"#include <algo.h>AlignmentManager* g_pAlignmentManager = NULL;//////////////////////////////////////////////////////////////////////////////// class AlignmentManager member methods//////////////////////////////////////////////////////////////////////////////AlignmentManager::AlignmentManager() throw(){ __BEGIN_TRY __END_CATCH}AlignmentManager::~AlignmentManager() throw(){ __BEGIN_TRY __END_CATCH}Alignment AlignmentManager::getAlignmentType(Alignment_t Alignment) throw(){ __BEGIN_TRY if (Alignment <= -10000) { return LESS_EVIL; } if (Alignment >= -10000 && Alignment < -7500) { return LESS_EVIL; } else if (Alignment >= -7500 && Alignment < -2500) { return EVIL; } else if (Alignment >= -2500 && Alignment < 2500) { return NEUTRAL; } else if (Alignment >= 2500 && Alignment < 7500) { return GOOD; } else if (Alignment >= 7500 && Alignment <= 10000) { return MORE_GOOD; } else { return MORE_GOOD; } __END_CATCH}int AlignmentManager::getMultiplier(Alignment_t AttackerAlignment, Alignment_t DefenderAlignment) throw(){ __BEGIN_TRY Alignment AAlignmentType = getAlignmentType(AttackerAlignment); Alignment DAlignmentType = getAlignmentType(DefenderAlignment); // 傍拜磊狼 己氢捞 Good, More Good 捞搁 if (AAlignmentType >= GOOD) { // 规绢磊狼 己氢捞 GOOD, More Good 捞搁 if (DAlignmentType >= GOOD) { // 傍拜磊狼 己氢捞 惑措 急捞搁 -2 if (AttackerAlignment > DefenderAlignment) { return -200; } // 傍拜磊狼 己氢捞 惑措 厩捞搁 -3 else if (AttackerAlignment <= DefenderAlignment) { return -300; } } // 规绢磊狼 己氢捞 NEUTRAL 捞搁, else if (DAlignmentType == NEUTRAL) { return -100; } // 规绢磊狼 己氢捞 Evil, Less Evil 捞搁, else if (DAlignmentType <= EVIL) { return 200; } } else if (getAlignmentType(AttackerAlignment) == NEUTRAL) { // 规绢磊狼 己氢捞 GOOD, More Good 捞搁 if (DAlignmentType >= GOOD) { return -300; } // 规绢磊狼 己氢捞 NEUTRAL 捞搁, else if (DAlignmentType == NEUTRAL) { // 傍拜磊狼 己氢捞 惑措 急捞搁 -1 if (AttackerAlignment > DefenderAlignment) { return -100; } // 傍拜磊狼 己氢捞 惑措 厩捞搁 -2 else if (AttackerAlignment <= DefenderAlignment) { return -200; } } // 规绢磊狼 己氢捞 Evil, Less Evil 捞搁, else if (DAlignmentType <= EVIL) { return 100; } } else if (getAlignmentType(AttackerAlignment) <= EVIL) { // 规绢磊狼 己氢捞 GOOD, More Good 捞搁 if (DAlignmentType >= GOOD) { return -300; } // 规绢磊狼 己氢捞 NEUTRAL 捞搁, else if (DAlignmentType == NEUTRAL) { return -200; } // 规绢磊狼 己氢捞 Evil, Less Evil 捞搁, else if (DAlignmentType <= EVIL) { // 傍拜磊狼 己氢捞 惑措 急捞搁 2 if (AttackerAlignment > DefenderAlignment) { return 200; } // 傍拜磊狼 己氢捞 惑措 厩捞搁 1 else if (AttackerAlignment <= DefenderAlignment) { return 100; } } } else { return -300; } return -300; __END_CATCH}BYTE AlignmentManager::getDropItemNum(Alignment_t Alignment, bool isPK) throw(){ __BEGIN_TRY int Count = 0; if (Alignment > -10000 && Alignment < -7500) { Count = 2; } else if (Alignment >= -7500 && Alignment < -2500) { Count = 1; } else if (Alignment == -10000) { Count = 3; } /* 攫力 函版等 瘤绰 舅 荐 绝瘤父, 己氢捞 馒茄 荤恩捞 酒捞袍阑 冻绢哆府绰 老捞 惯积窍扁 矫累沁促. PCManager.cpp狼 killCreature() 何盒狼 林籍阑 粱 瘤快促啊 抗傈俊 购啊 乐带 巴阑 朝赴 巴 鞍篮单, 老窜 己氢捞 馒茄 荤恩捞 酒捞袍阑 冻绢哆府瘤 臼霸 窍扁 困秦辑 捞 何盒阑 林籍贸府茄促. -- 2001.12.25 辫己刮 int Percent = getDropBonusPercentage(Alignment); if (isPK) { Count = max(0, Count - 1); Percent = Percent/2; } Count = max(0, Count); Count = min(5, Count); if (Random(1, 100) < Percent) { Count++; } */ return (BYTE)Count; __END_CATCH}BYTE AlignmentManager::getDropBonusPercentage(Alignment_t Alignment) throw(){ __BEGIN_TRY return 0; int Percent = (10000 - Alignment) / 400; Percent = max(0, Percent); Percent = min(50, Percent); return (BYTE)Percent; __END_CATCH}BYTE AlignmentManager::getMoneyDropPenalty(Alignment_t Alignment) throw(){ __BEGIN_TRY BYTE Penalty = 0; if (Alignment == 10000) { Penalty = 0; } else if (Alignment >= 7500 && Alignment < 10000) { Penalty = 1; } else if (Alignment >= 2500 && Alignment < 7500) { Penalty = 2; } else if (Alignment >= -2500 && Alignment < 2500) { Penalty = 4; } else if (Alignment >= -7500 && Alignment < -2500) { Penalty = 8; } else if (Alignment >= -10000 && Alignment < -7500) { Penalty = 16; } else { Penalty = 32; } return Penalty; __END_CATCH}string AlignmentManager::toString() const throw(){ __BEGIN_TRY StringStream msg; msg << "AlignmentManager (" << ")"; return msg.toString(); __END_CATCH}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -